unsetenv: work around Haiku issues
authorEric Blake <eblake@redhat.com>
Sat, 5 Feb 2011 21:31:59 +0000 (14:31 -0700)
committerEric Blake <eblake@redhat.com>
Sat, 5 Feb 2011 22:19:15 +0000 (15:19 -0700)
commitad98f8ef519af652b76508875f037fb3ca95a35f
tree97744c8cbe039e9dcf41014473f43459442524a1
parentabac9b73490cd4d59a1e454c6ade5fd2073f2d2f
unsetenv: work around Haiku issues

On Haiku alpha 2, test-unsetenv.c passed in isolation with just
system headers, but failed when libgnu and replacement headers
were in use.  Why?  Because putenv("a") fails to remove "a=..."
from the environment, but the gnulib rpl_putenv works by
assigning to environ.  Apparently, Haiku is doing some funky
caching issues, and correctly removes all vestiges of environment
duplicates when Haiku is in charge, but not after assigning to
environ forces Haiku to rebuild its cache.

The m4 change is sufficient to detect Haiku's oddities, and the
existing replacement then passes just fine.

* m4/setenv.m4 (gl_FUNC_UNSETENV): Also detect Haiku issue.
* doc/posix-functions/unsetenv.texi (unsetenv): Document it.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
doc/posix-functions/unsetenv.texi
m4/setenv.m4