summaryrefslogtreecommitdiff
path: root/tests/test-unsetenv.c
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-12-10 12:18:31 -0700
committerEric Blake <ebb9@byu.net>2009-12-11 13:57:28 -0700
commit91e21656de5ae1e87d23465ce46e738be45a7254 (patch)
tree26245d771735e0a0ae14408abcdce507cff8e7ee /tests/test-unsetenv.c
parenta3255b1b9848874572e0df9d0609e263da50de4b (diff)
downloadgnulib-91e21656de5ae1e87d23465ce46e738be45a7254.tar.gz
setenv: relax requirement in light of POSIX ruling
Requiring that {un,}setenv gracefully reject NULL is just a waste of processing power; POSIX agreed to this argument in http://austingroupbugs.net/view.php?id=185 so we no longer worry whether a native implementation handles NULL. * m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE): Test handling of "" but not NULL. * tests/test-setenv.c (main): Relax test. * tests/test-unsetenv.c (main): Likewise. * doc/posix-functions/setenv.texi (setenv): Document this. * doc/posix-functions/unsetenv.texi (unsetenv): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'tests/test-unsetenv.c')
-rw-r--r--tests/test-unsetenv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test-unsetenv.c b/tests/test-unsetenv.c
index 11af82c991..2815cf3a39 100644
--- a/tests/test-unsetenv.c
+++ b/tests/test-unsetenv.c
@@ -57,9 +57,13 @@ main (void)
errno = 0;
ASSERT (unsetenv ("a=b") == -1);
ASSERT (errno == EINVAL);
+#if 0
+ /* glibc and gnulib's implementation guarantee this, but POSIX no
+ longer requires it: http://austingroupbugs.net/view.php?id=185 */
errno = 0;
ASSERT (unsetenv (NULL) == -1);
ASSERT (errno == EINVAL);
+#endif
return 0;
}