From owner-svn-src-head@freebsd.org Tue Jul 10 02:43:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43B1310327B5; Tue, 10 Jul 2018 02:43:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFA3F77ABA; Tue, 10 Jul 2018 02:43:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 916EB1DD98; Tue, 10 Jul 2018 02:43:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6A2hNtO035291; Tue, 10 Jul 2018 02:43:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6A2hN5M035290; Tue, 10 Jul 2018 02:43:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201807100243.w6A2hN5M035290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Jul 2018 02:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336157 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 336157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2018 02:43:24 -0000 Author: kevans Date: Tue Jul 10 02:43:22 2018 New Revision: 336157 URL: https://svnweb.freebsd.org/changeset/base/336157 Log: kern_environment: bool'itize dynamic_kenv; fix small style(9) nit Modified: head/sys/kern/kern_environment.c head/sys/sys/systm.h Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Tue Jul 10 01:42:28 2018 (r336156) +++ head/sys/kern/kern_environment.c Tue Jul 10 02:43:22 2018 (r336157) @@ -39,7 +39,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -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; Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue Jul 10 01:42:28 2018 (r336156) +++ head/sys/sys/systm.h Tue Jul 10 02:43:22 2018 (r336157) @@ -156,7 +156,7 @@ void kassert_panic(const char *fmt, ...) __printflike * 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;