# HG changeset patch # User Paul Eggert # Date 1363158630 25200 # Node ID 2a9ec0103b3c2cb6259ff6013ba856a64b98ca6f # Parent a4a11de0798079b7bb0a2d41127edceb37654646 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. diff -r a4a11de07980 -r 2a9ec0103b3c ChangeLog --- a/ChangeLog Tue Mar 12 17:30:10 2013 -0700 +++ b/ChangeLog Wed Mar 13 00:10:30 2013 -0700 @@ -1,3 +1,12 @@ +2013-03-13 Paul Eggert + + 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. + 2013-03-12 Paul Eggert mktime: fix configure typo diff -r a4a11de07980 -r 2a9ec0103b3c lib/putenv.c --- a/lib/putenv.c Tue Mar 12 17:30:10 2013 -0700 +++ b/lib/putenv.c Wed Mar 13 00:10:30 2013 -0700 @@ -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 } diff -r a4a11de07980 -r 2a9ec0103b3c m4/putenv.m4 --- a/m4/putenv.m4 Tue Mar 12 17:30:10 2013 -0700 +++ b/m4/putenv.m4 Wed Mar 13 00:10:30 2013 -0700 @@ -1,4 +1,4 @@ -# putenv.m4 serial 19 +# putenv.m4 serial 20 dnl Copyright (C) 2002-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -52,5 +52,5 @@ # Prerequisites of lib/putenv.c. AC_DEFUN([gl_PREREQ_PUTENV], [ - AC_CHECK_FUNCS([_putenv]) + AC_CHECK_DECLS([_putenv]) ])