aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2013-03-13 00:15:17 -0700
committerPaul Eggert2013-03-13 00:15:17 -0700
commit2c3f72f4b5f7d00cf0131998957c24812c8f6a53 (patch)
tree88a4070dc895f0cb525f35ad7e1dc4614356ca9f
parent7fd8c501a0de9e2f52a3ba6989646e3aa391649f (diff)
downloademacs-2c3f72f4b5f7d00cf0131998957c24812c8f6a53.tar.gz
emacs-2c3f72f4b5f7d00cf0131998957c24812c8f6a53.zip
Merge from gnulib: putenv: port to Solaris 10.
-rw-r--r--ChangeLog1
-rw-r--r--lib/putenv.c10
-rw-r--r--m4/putenv.m44
3 files changed, 8 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 1dfbeae4c56..2ac8ec1de5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
12013-03-13 Paul Eggert <eggert@cs.ucla.edu> 12013-03-13 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Merge from gnulib, incorporating: 3 Merge from gnulib, incorporating:
4 2013-03-13 putenv: port to Solaris 10
4 2013-03-12 mktime: fix configure typo 5 2013-03-12 mktime: fix configure typo
5 2013-03-11 regex: port to mingw's recent addition of undeclared alarm 6 2013-03-11 regex: port to mingw's recent addition of undeclared alarm
6 2013-03-11 putenv: avoid compilation warning on mingw 7 2013-03-11 putenv: avoid compilation warning on mingw
diff --git a/lib/putenv.c b/lib/putenv.c
index 3813a11ece7..5461273084e 100644
--- a/lib/putenv.c
+++ b/lib/putenv.c
@@ -62,7 +62,7 @@ static int
62_unsetenv (const char *name) 62_unsetenv (const char *name)
63{ 63{
64 size_t len; 64 size_t len;
65#if !HAVE__PUTENV 65#if !HAVE_DECL__PUTENV
66 char **ep; 66 char **ep;
67#endif 67#endif
68 68
@@ -74,7 +74,7 @@ _unsetenv (const char *name)
74 74
75 len = strlen (name); 75 len = strlen (name);
76 76
77#if HAVE__PUTENV 77#if HAVE_DECL__PUTENV
78 { 78 {
79 int putenv_result, putenv_errno; 79 int putenv_result, putenv_errno;
80 char *name_ = malloc (len + 2); 80 char *name_ = malloc (len + 2);
@@ -127,9 +127,9 @@ putenv (char *string)
127 return _unsetenv (string); 127 return _unsetenv (string);
128 } 128 }
129 129
130#if HAVE__PUTENV 130#if HAVE_DECL__PUTENV
131 /* Rely on _putenv to allocate the new environment. If other 131 /* Rely on _putenv to allocate the new environment. If other
132 parts of the application use _putenv, the !HAVE__PUTENV code 132 parts of the application use _putenv, the !HAVE_DECL__PUTENV code
133 would fight over who owns the environ vector, causing a crash. */ 133 would fight over who owns the environ vector, causing a crash. */
134 if (name_end[1]) 134 if (name_end[1])
135 return _putenv (string); 135 return _putenv (string);
@@ -188,7 +188,7 @@ putenv (char *string)
188 last_environ = new_environ; 188 last_environ = new_environ;
189 environ = new_environ; 189 environ = new_environ;
190 } 190 }
191#endif
192 191
193 return 0; 192 return 0;
193#endif
194} 194}
diff --git a/m4/putenv.m4 b/m4/putenv.m4
index 03ed4f97dbe..c33b5b5170e 100644
--- a/m4/putenv.m4
+++ b/m4/putenv.m4
@@ -1,4 +1,4 @@
1# putenv.m4 serial 19 1# putenv.m4 serial 20
2dnl Copyright (C) 2002-2013 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2013 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -52,5 +52,5 @@ AC_DEFUN([gl_FUNC_PUTENV],
52# Prerequisites of lib/putenv.c. 52# Prerequisites of lib/putenv.c.
53AC_DEFUN([gl_PREREQ_PUTENV], 53AC_DEFUN([gl_PREREQ_PUTENV],
54[ 54[
55 AC_CHECK_FUNCS([_putenv]) 55 AC_CHECK_DECLS([_putenv])
56]) 56])