emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112025: Merge from gnulib.


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112025: Merge from gnulib.
Date: Tue, 12 Mar 2013 17:38:42 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112025
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2013-03-12 17:38:42 -0700
message:
  Merge from gnulib.
  
  This incorporates:
  2013-03-12 mktime: fix configure typo
  2013-03-11 regex: port to mingw's recent addition of undeclared alarm
  2013-03-11 putenv: avoid compilation warning on mingw
  2013-03-11 unistd: don't prevent Tru64 Unix from using gnulib strtod.
modified:
  ChangeLog
  lib/putenv.c
  lib/unistd.in.h
  m4/mktime.m4
=== modified file 'ChangeLog'
--- a/ChangeLog 2013-03-11 16:31:55 +0000
+++ b/ChangeLog 2013-03-13 00:38:42 +0000
@@ -1,3 +1,11 @@
+2013-03-13  Paul Eggert  <address@hidden>
+
+       Merge from gnulib, incorporating:
+       2013-03-12 mktime: fix configure typo
+       2013-03-11 regex: port to mingw's recent addition of undeclared alarm
+       2013-03-11 putenv: avoid compilation warning on mingw
+       2013-03-11 unistd: don't prevent Tru64 Unix from using gnulib strtod.
+
 2013-03-06  Paul Eggert  <address@hidden>
 
        * configure.ac (TERM_HEADER): Remove duplicate definition (Bug#13872).

=== modified file 'lib/putenv.c'
--- a/lib/putenv.c      2013-03-01 15:16:43 +0000
+++ b/lib/putenv.c      2013-03-13 00:38:42 +0000
@@ -62,7 +62,9 @@
 _unsetenv (const char *name)
 {
   size_t len;
+#if !HAVE__PUTENV
   char **ep;
+#endif
 
   if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
     {
@@ -126,45 +128,45 @@
     }
 
 #if HAVE__PUTENV
-      /* Rely on _putenv to allocate the new environment.  If other
-         parts of the application use _putenv, the !HAVE__PUTENV code
-         would fight over who owns the environ vector, causing a crash.  */
-      if (name_end[1])
-        return _putenv (string);
-      else
+  /* Rely on _putenv to allocate the new environment.  If other
+     parts of the application use _putenv, the !HAVE__PUTENV code
+     would fight over who owns the environ vector, causing a crash.  */
+  if (name_end[1])
+    return _putenv (string);
+  else
+    {
+      /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ")
+         to allocate the environ vector and then replace the new
+         entry with "NAME=".  */
+      int putenv_result, putenv_errno;
+      char *name_x = malloc (name_end - string + sizeof "= ");
+      if (!name_x)
+        return -1;
+      memcpy (name_x, string, name_end - string + 1);
+      name_x[name_end - string + 1] = ' ';
+      name_x[name_end - string + 2] = 0;
+      putenv_result = _putenv (name_x);
+      putenv_errno = errno;
+      for (ep = environ; *ep; ep++)
+        if (strcmp (*ep, name_x) == 0)
+          {
+            *ep = string;
+            break;
+          }
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+      if (putenv_result == 0)
         {
-          /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ")
-             to allocate the environ vector and then replace the new
-             entry with "NAME=".  */
-          int putenv_result, putenv_errno;
-          char *name_x = malloc (name_end - string + sizeof "= ");
-          if (!name_x)
-            return -1;
-          memcpy (name_x, string, name_end - string + 1);
-          name_x[name_end - string + 1] = ' ';
-          name_x[name_end - string + 2] = 0;
-          putenv_result = _putenv (name_x);
-          putenv_errno = errno;
-          for (ep = environ; *ep; ep++)
-            if (strcmp (*ep, name_x) == 0)
-              {
-                *ep = string;
-                break;
-              }
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-          if (putenv_result == 0)
-            {
-              /* _putenv propagated "NAME= " into the subprocess environment;
-                 fix that by calling SetEnvironmentVariable directly.  */
-              name_x[name_end - string] = 0;
-              putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1;
-              putenv_errno = ENOMEM; /* ENOMEM is the only way to fail.  */
-            }
-# endif
-          free (name_x);
-          __set_errno (putenv_errno);
-          return putenv_result;
+          /* _putenv propagated "NAME= " into the subprocess environment;
+             fix that by calling SetEnvironmentVariable directly.  */
+          name_x[name_end - string] = 0;
+          putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1;
+          putenv_errno = ENOMEM; /* ENOMEM is the only way to fail.  */
         }
+# endif
+      free (name_x);
+      __set_errno (putenv_errno);
+      return putenv_result;
+    }
 #else
   for (ep = environ; *ep; ep++)
     if (strncmp (*ep, string, name_end - string) == 0

=== modified file 'lib/unistd.in.h'
--- a/lib/unistd.in.h   2013-02-08 23:37:17 +0000
+++ b/lib/unistd.in.h   2013-03-13 00:38:42 +0000
@@ -61,8 +61,10 @@
 /* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
    <unistd.h>.  */
 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
+/* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is
+   included here.  */
 /* But avoid namespace pollution on glibc systems.  */
-#ifndef __GLIBC__
+#if !defined __GLIBC__ && !defined __osf__
 # define __need_system_stdlib_h
 # include <stdlib.h>
 # undef __need_system_stdlib_h

=== modified file 'm4/mktime.m4'
--- a/m4/mktime.m4      2013-01-01 09:11:05 +0000
+++ b/m4/mktime.m4      2013-03-13 00:38:42 +0000
@@ -1,4 +1,4 @@
-# serial 24
+# serial 25
 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2013 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -14,7 +14,7 @@
   dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained
   dnl in Autoconf and because it invokes AC_LIBOBJ.
   AC_CHECK_HEADERS_ONCE([unistd.h])
-  AC_CHECK_FUNCS_ONCE([alarm])
+  AC_CHECK_DECLS_ONCE([alarm])
   AC_REQUIRE([gl_MULTIARCH])
   if test $APPLE_UNIVERSAL_BUILD = 1; then
     # A universal build on Apple Mac OS X platforms.
@@ -34,8 +34,8 @@
 # include <unistd.h>
 #endif
 
-#ifndef HAVE_ALARM
-# define alarm(X) /* empty */
+#if HAVE_DECL_ALARM
+# include <signal.h>
 #endif
 
 /* Work around redefinition to rpl_putenv by other config tests.  */
@@ -171,10 +171,13 @@
   int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
   int time_t_signed = ! ((time_t) 0 < (time_t) -1);
 
+#if HAVE_DECL_ALARM
   /* This test makes some buggy mktime implementations loop.
      Give up after 60 seconds; a mktime slower than that
      isn't worth using anyway.  */
+  signal (SIGALRM, SIG_DFL);
   alarm (60);
+#endif
 
   time_t_max = (! time_t_signed
                 ? (time_t) -1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]