Use getenv_is_true() in init_static_kenv()
A small example of how these functions can be used to simplify checks of this nature. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26271
This commit is contained in:
parent
e32d47f32d
commit
624a7e1f4f
@ -253,7 +253,6 @@ done:
|
||||
void
|
||||
init_static_kenv(char *buf, size_t len)
|
||||
{
|
||||
char *eval;
|
||||
|
||||
KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized"));
|
||||
/*
|
||||
@ -301,20 +300,17 @@ init_static_kenv(char *buf, size_t len)
|
||||
* if the static environment has disabled the loader environment.
|
||||
*/
|
||||
kern_envp = static_env;
|
||||
eval = kern_getenv("loader_env.disabled");
|
||||
if (eval == NULL || strcmp(eval, "1") != 0) {
|
||||
if (!getenv_is_true("loader_env.disabled")) {
|
||||
md_envp = buf;
|
||||
md_env_len = len;
|
||||
md_env_pos = 0;
|
||||
|
||||
eval = kern_getenv("static_env.disabled");
|
||||
if (eval != NULL && strcmp(eval, "1") == 0) {
|
||||
if (getenv_is_true("static_env.disabled")) {
|
||||
kern_envp[0] = '\0';
|
||||
kern_envp[1] = '\0';
|
||||
}
|
||||
}
|
||||
eval = kern_getenv("static_hints.disabled");
|
||||
if (eval != NULL && strcmp(eval, "1") == 0) {
|
||||
if (getenv_is_true("static_hints.disabled")) {
|
||||
static_hints[0] = '\0';
|
||||
static_hints[1] = '\0';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user