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.
This commit is contained in:
Jaakko Heinonen 2011-05-07 11:10:58 +00:00
parent f93ef5516b
commit 816c203937
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=221597

View File

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