From owner-svn-src-head@FreeBSD.ORG Sat May 7 11:10:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B97A31065672; Sat, 7 May 2011 11:10:58 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA12F8FC14; Sat, 7 May 2011 11:10:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p47BAwuv096096; Sat, 7 May 2011 11:10:58 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p47BAwmU096094; Sat, 7 May 2011 11:10:58 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201105071110.p47BAwmU096094@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 7 May 2011 11:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221597 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 07 May 2011 11:10:59 -0000 Author: jh Date: Sat May 7 11:10:58 2011 New Revision: 221597 URL: http://svn.freebsd.org/changeset/base/221597 Log: Add WITNESS_WARN() to getenv() to explicitly note that the function may sleep. This helps to expose bugs when the requested environment variable doesn't exist. Modified: head/sys/kern/kern_environment.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Sat May 7 11:05:16 2011 (r221596) +++ head/sys/kern/kern_environment.c Sat May 7 11:10:58 2011 (r221597) @@ -310,6 +310,7 @@ 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) {