diff options
| author | Paul Eggert | 2013-03-13 00:15:17 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-03-13 00:15:17 -0700 |
| commit | 2c3f72f4b5f7d00cf0131998957c24812c8f6a53 (patch) | |
| tree | 88a4070dc895f0cb525f35ad7e1dc4614356ca9f | |
| parent | 7fd8c501a0de9e2f52a3ba6989646e3aa391649f (diff) | |
| download | emacs-2c3f72f4b5f7d00cf0131998957c24812c8f6a53.tar.gz emacs-2c3f72f4b5f7d00cf0131998957c24812c8f6a53.zip | |
Merge from gnulib: putenv: port to Solaris 10.
| -rw-r--r-- | ChangeLog | 1 | ||||
| -rw-r--r-- | lib/putenv.c | 10 | ||||
| -rw-r--r-- | m4/putenv.m4 | 4 |
3 files changed, 8 insertions, 7 deletions
| @@ -1,6 +1,7 @@ | |||
| 1 | 2013-03-13 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2013-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 |
| 2 | dnl Copyright (C) 2002-2013 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2002-2013 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl 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. |
| 53 | AC_DEFUN([gl_PREREQ_PUTENV], | 53 | AC_DEFUN([gl_PREREQ_PUTENV], |
| 54 | [ | 54 | [ |
| 55 | AC_CHECK_FUNCS([_putenv]) | 55 | AC_CHECK_DECLS([_putenv]) |
| 56 | ]) | 56 | ]) |