To avoid duplicated warning, move WITNESS_WARN() added in r221597 to the

branch which doesn't call malloc(9).

Suggested by:	kib
This commit is contained in:
Jaakko Heinonen 2011-05-07 17:59:07 +00:00
parent a63f3da5b2
commit 852bee75b7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=221607

View File

@ -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);