diff options
author | peter <peter@FreeBSD.org> | 2002-05-01 02:51:50 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-05-01 02:51:50 +0000 |
commit | 84ae7c9225ad2a47a4cc049336fa980aa2daeee3 (patch) | |
tree | df763127b1ab618a82883b0fe5617e1d04c7949d /sys | |
parent | 336f78b18ad5468d78263e8fcc2dc14d0a223042 (diff) | |
download | FreeBSD-src-84ae7c9225ad2a47a4cc049336fa980aa2daeee3.zip FreeBSD-src-84ae7c9225ad2a47a4cc049336fa980aa2daeee3.tar.gz |
Cosmetic tweaks. Try and keep the style more consistent, catch some stray
whitespace and update a comment.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_environment.c | 83 | ||||
-rw-r--r-- | sys/kern/subr_hints.c | 5 |
2 files changed, 43 insertions, 45 deletions
diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c index a5c5e08..a33b0c7 100644 --- a/sys/kern/kern_environment.c +++ b/sys/kern/kern_environment.c @@ -85,7 +85,7 @@ kenv(td, uap) char *name, *value; size_t len, done; int error, i; - + KASSERT(dynamic_kenv, ("kenv: dynamic_kenv = 0")); error = 0; @@ -368,16 +368,16 @@ unsetenv(const char *name) int getenv_string(const char *name, char *data, int size) { - char *tmp; + char *tmp; - tmp = getenv(name); - if (tmp != NULL) { - strncpy(data, tmp, size); - freeenv(tmp); - data[size - 1] = 0; - return (1); - } else - return (0); + tmp = getenv(name); + if (tmp != NULL) { + strncpy(data, tmp, size); + freeenv(tmp); + data[size - 1] = 0; + return (1); + } else + return (0); } /* @@ -386,14 +386,13 @@ getenv_string(const char *name, char *data, int size) int getenv_int(const char *name, int *data) { - quad_t tmp; - int rval; - - rval = getenv_quad(name, &tmp); - if (rval) { - *data = (int) tmp; - } - return (rval); + quad_t tmp; + int rval; + + rval = getenv_quad(name, &tmp); + if (rval) + *data = (int) tmp; + return (rval); } /* @@ -402,22 +401,21 @@ getenv_int(const char *name, int *data) int getenv_quad(const char *name, quad_t *data) { - char *value; - char *vtp; - quad_t iv; - - if ((value = getenv(name)) == NULL) - return(0); - - iv = strtoq(value, &vtp, 0); - if ((vtp == value) || (*vtp != '\0')) { - freeenv(value); - return(0); - } - - freeenv(value); - *data = iv; - return(1); + char *value; + char *vtp; + quad_t iv; + + value = getenv(name); + if (value == NULL) + return (0); + iv = strtoq(value, &vtp, 0); + if ((vtp == value) || (*vtp != '\0')) { + freeenv(value); + return (0); + } + freeenv(value); + *data = iv; + return (1); } /* @@ -427,14 +425,15 @@ getenv_quad(const char *name, quad_t *data) static char * kernenv_next(char *cp) { - if (cp != NULL) { - while (*cp != 0) - cp++; - cp++; - if (*cp == 0) - cp = NULL; - } - return(cp); + + if (cp != NULL) { + while (*cp != 0) + cp++; + cp++; + if (*cp == 0) + cp = NULL; + } + return (cp); } void diff --git a/sys/kern/subr_hints.c b/sys/kern/subr_hints.c index 919106e..c68d607 100644 --- a/sys/kern/subr_hints.c +++ b/sys/kern/subr_hints.c @@ -61,7 +61,7 @@ res_find(int *line, int *startln, if (checkmethod) { switch (hintmode) { - case 0: /* config supplied nothing */ + case 0: /* loader hints in environment only */ break; case 1: /* static hints only */ hintp = static_hints; @@ -118,9 +118,8 @@ res_find(int *line, int *startln, sx_sunlock(&kenv_lock); return (ENOENT); } - } else { + } else cp = hintp; - } while (cp) { hit = 1; (*line)++; |