kern_environment: bool'itize dynamic_kenv; fix small style(9) nit
This commit is contained in:
parent
34e314e794
commit
c7a82b9c6c
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user