]> Savannah Git Hosting - gnulib.git/commitdiff
mktime: call tzset as per POSIX
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 3 Jul 2016 10:59:54 +0000 (12:59 +0200)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 3 Jul 2016 11:00:42 +0000 (13:00 +0200)
Problem reported by Ludovic Courtès in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-06/msg00068.html
* lib/mktime.c (mktime) [!_LIBC && HAVE_TZSET]: Call tzset.
* m4/mktime.m4 (gl_FUNC_MKTIME): Check for tzset.

ChangeLog
lib/mktime.c
m4/mktime.m4

index 34b651f24286bde6b0a2933bd2a80eba4cb3f960..ef332683bb8afce5ecad2c5e06dc8d1e1f2bda82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-07-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       mktime: call tzset as per POSIX
+       Problem reported by Ludovic Courtès in:
+       http://lists.gnu.org/archive/html/bug-gnulib/2016-06/msg00068.html
+       * lib/mktime.c (mktime) [!_LIBC && HAVE_TZSET]: Call tzset.
+       * m4/mktime.m4 (gl_FUNC_MKTIME): Check for tzset.
+
 2016-06-26  Pádraig Brady  <P@draigBrady.com>
 
        fts: handle readdir() errors
index 87ab633a1317e1ee967b75c7b0fb6472730a0d2e..9eb3e76524ac1e21a81151ba3d18729ca394f4f2 100644 (file)
@@ -470,6 +470,8 @@ mktime (struct tm *tp)
      time zone names contained in the external variable 'tzname' shall
      be set as if the tzset() function had been called.  */
   __tzset ();
+#elif HAVE_TZSET
+  tzset ();
 #endif
 
   return __mktime_internal (tp, __localtime_r, &localtime_offset);
index 5a0f2d88ab031b73c3bf971ff836b4fa713e3fb9..23cad732ff47db9b1e26f162dea46c6c9046e29a 100644 (file)
@@ -1,4 +1,4 @@
-# serial 26
+# serial 27
 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -30,6 +30,7 @@ AC_DEFUN([gl_FUNC_MKTIME],
   dnl in Autoconf and because it invokes AC_LIBOBJ.
   AC_CHECK_HEADERS_ONCE([unistd.h])
   AC_CHECK_DECLS_ONCE([alarm])
+  AC_CHECK_FUNCS_ONCE([tzset])
   AC_REQUIRE([gl_MULTIARCH])
   if test $APPLE_UNIVERSAL_BUILD = 1; then
     # A universal build on Apple Mac OS X platforms.