Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 May 2011 17:59:07 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221607 - head/sys/kern
Message-ID:  <201105071759.p47Hx7dt009085@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Sat May  7 17:59:07 2011
New Revision: 221607
URL: http://svn.freebsd.org/changeset/base/221607

Log:
  To avoid duplicated warning, move WITNESS_WARN() added in r221597 to the
  branch which doesn't call malloc(9).
  
  Suggested by:	kib

Modified:
  head/sys/kern/kern_environment.c

Modified: head/sys/kern/kern_environment.c
==============================================================================
--- head/sys/kern/kern_environment.c	Sat May  7 17:23:13 2011	(r221606)
+++ head/sys/kern/kern_environment.c	Sat May  7 17:59:07 2011	(r221607)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105071759.p47Hx7dt009085>