summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_environment.c
diff options
context:
space:
mode:
authorjh <jh@FreeBSD.org>2011-05-07 17:59:07 +0000
committerjh <jh@FreeBSD.org>2011-05-07 17:59:07 +0000
commit264f4e742ac6e17a93d1975809b17bfbf79c4fc2 (patch)
treef4e5fb6e368efd98010a4fbc66e381ce4a89563b /sys/kern/kern_environment.c
parentb7e6c09c4f4089b8e9be6f25ab74509a8fbf88f7 (diff)
downloadFreeBSD-src-264f4e742ac6e17a93d1975809b17bfbf79c4fc2.zip
FreeBSD-src-264f4e742ac6e17a93d1975809b17bfbf79c4fc2.tar.gz
To avoid duplicated warning, move WITNESS_WARN() added in r221597 to the
branch which doesn't call malloc(9). Suggested by: kib
Diffstat (limited to 'sys/kern/kern_environment.c')
-rw-r--r--sys/kern/kern_environment.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c
index ce8e778..41a9fa8 100644
--- a/sys/kern/kern_environment.c
+++ b/sys/kern/kern_environment.c
@@ -310,7 +310,6 @@ getenv(const char *name)
int len;
if (dynamic_kenv) {
- WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "getenv");
mtx_lock(&kenv_lock);
cp = _getenv_dynamic(name, NULL);
if (cp != NULL) {
@@ -322,6 +321,8 @@ getenv(const char *name)
} else {
mtx_unlock(&kenv_lock);
ret = NULL;
+ WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
+ "getenv");
}
} else
ret = _getenv_static(name);
OpenPOWER on IntegriCloud