aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-07-10 02:43:22 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-07-10 02:43:22 +0000
commitc7a82b9c6c7e8450883ad1e5f663dd1ff58515ac (patch)
treeabf8f9f606ac0d9e44022d68d04b07013e5365ed
parent34e314e794c323387e9423037c7715fdbe27915f (diff)
downloadsrc-c7a82b9c6c7e8450883ad1e5f663dd1ff58515ac.tar.gz
src-c7a82b9c6c7e8450883ad1e5f663dd1ff58515ac.zip
kern_environment: bool'itize dynamic_kenv; fix small style(9) nit
Notes
Notes: svn path=/head/; revision=336157
-rw-r--r--sys/kern/kern_environment.c9
-rw-r--r--sys/sys/systm.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c
index d5f0873fa40e..dbac88315b32 100644
--- a/sys/kern/kern_environment.c
+++ b/sys/kern/kern_environment.c
@@ -39,7 +39,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/queue.h>
@@ -81,7 +80,7 @@ struct mtx kenv_lock;
/*
* No need to protect this with a mutex since SYSINITS are single threaded.
*/
-int dynamic_kenv = 0;
+bool dynamic_kenv;
#define KENV_CHECK if (!dynamic_kenv) \
panic("%s: called before SI_SUB_KMEM", __func__)
@@ -100,7 +99,7 @@ sys_kenv(td, uap)
size_t len, done, needed, buflen;
int error, i;
- KASSERT(dynamic_kenv, ("kenv: dynamic_kenv = 0"));
+ KASSERT(dynamic_kenv, ("kenv: dynamic_kenv = false"));
error = 0;
if (uap->what == KENV_DUMP) {
@@ -344,7 +343,7 @@ init_dynamic_kenv(void *data __unused)
kenvp[dynamic_envpos] = NULL;
mtx_init(&kenv_lock, "kernel environment", NULL, MTX_DEF);
- dynamic_kenv = 1;
+ dynamic_kenv = true;
}
SYSINIT(kenv, SI_SUB_KMEM + 1, SI_ORDER_FIRST, init_dynamic_kenv, NULL);
@@ -498,7 +497,7 @@ kern_setenv(const char *name, const char *value)
char *buf, *cp, *oldenv;
int namelen, vallen, i;
- if (dynamic_kenv == 0 && md_env_len > 0)
+ if (!dynamic_kenv && md_env_len > 0)
return (setenv_static(name, value));
KENV_CHECK;
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index eba8c9a048d7..bb13c1b2047b 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -156,7 +156,7 @@ void kassert_panic(const char *fmt, ...) __printflike(1, 2);
* XXX most of these variables should be const.
*/
extern int osreldate;
-extern int dynamic_kenv;
+extern bool dynamic_kenv;
extern struct mtx kenv_lock;
extern char *kern_envp;
extern char *md_envp;