Page MenuHomeFreeBSD

D8491.id22125.diff
No OneTemporary

D8491.id22125.diff

Index: lib/libstand/nfs.c
===================================================================
--- lib/libstand/nfs.c
+++ lib/libstand/nfs.c
@@ -223,6 +223,7 @@
nfs_getrootfh(struct iodesc *d, char *path, u_char *fhp)
{
int len;
+ char *env, *end;
struct args {
n_long len;
char path[FNAME_SIZE];
@@ -272,8 +273,14 @@
/*
* Improve boot performance over NFS
*/
- if (getenv("nfs.read_size") != NULL)
- nfs_read_size = strtol(getenv("nfs.read_size"), NULL, 0);
+ if ((env = getenv("nfs.read_size")) != NULL) {
+ nfs_read_size = strtol(env, &end, 0);
+ if (*env != '\0' || *end != '\0') {
+ printf("%s: bad value: \"%s\", defaulting to %d\n",
+ "nfs.read_size", env, NFSREAD_MIN_SIZE);
+ nfs_read_size = NFSREAD_MIN_SIZE;
+ }
+ }
if (nfs_read_size < NFSREAD_MIN_SIZE)
nfs_read_size = NFSREAD_MIN_SIZE;
if (nfs_read_size > NFSREAD_MAX_SIZE)

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 18, 1:48 AM (14 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25469552
Default Alt Text
D8491.id22125.diff (877 B)

Event Timeline