diff options
author | jh <jh@FreeBSD.org> | 2011-05-07 11:10:58 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2011-05-07 11:10:58 +0000 |
commit | f428a5f2b302c88f9975980d4f0ea0114338aec7 (patch) | |
tree | 7868052d88c710d1b62ea6c10f3e3ae293662f03 /sys/kern | |
parent | 496023c65b425b6ce5c01dd371afcafcf6d7ef23 (diff) | |
download | FreeBSD-src-f428a5f2b302c88f9975980d4f0ea0114338aec7.zip FreeBSD-src-f428a5f2b302c88f9975980d4f0ea0114338aec7.tar.gz |
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.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_environment.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c index 73551f4..ce8e778 100644 --- a/sys/kern/kern_environment.c +++ b/sys/kern/kern_environment.c @@ -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) { |