Mercurial > hg > octave-lojdl > gnulib-hg
diff lib/putenv.c @ 17370:2a9ec0103b3c
putenv: port to Solaris 10
* lib/putenv.c (_unsetenv, putenv): Use HAVE_DECL__PUTENV, not
HAVE__PUTENV. Solaris 10 has a _putenv that's not declared and
is not what is wanted here.
* m4/putenv.m4 (gl_PREREQ_PUTENV): Check for _putenv's
declaration, not for its existence.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Wed, 13 Mar 2013 00:10:30 -0700 |
parents | a154fccd3b21 |
children |
line wrap: on
line diff
--- a/lib/putenv.c +++ b/lib/putenv.c @@ -62,7 +62,7 @@ _unsetenv (const char *name) { size_t len; -#if !HAVE__PUTENV +#if !HAVE_DECL__PUTENV char **ep; #endif @@ -74,7 +74,7 @@ len = strlen (name); -#if HAVE__PUTENV +#if HAVE_DECL__PUTENV { int putenv_result, putenv_errno; char *name_ = malloc (len + 2); @@ -127,9 +127,9 @@ return _unsetenv (string); } -#if HAVE__PUTENV +#if HAVE_DECL__PUTENV /* Rely on _putenv to allocate the new environment. If other - parts of the application use _putenv, the !HAVE__PUTENV code + parts of the application use _putenv, the !HAVE_DECL__PUTENV code would fight over who owns the environ vector, causing a crash. */ if (name_end[1]) return _putenv (string); @@ -188,7 +188,7 @@ last_environ = new_environ; environ = new_environ; } -#endif return 0; +#endif }