changeset 18339:f1df88870b64

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.
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 03 Jul 2016 12:59:54 +0200
parents 7276fe79480b
children ec48ad192f8f
files ChangeLog lib/mktime.c m4/mktime.m4
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jun 22 13:49:53 2016 +0100
+++ b/ChangeLog	Sun Jul 03 12:59:54 2016 +0200
@@ -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
--- a/lib/mktime.c	Wed Jun 22 13:49:53 2016 +0100
+++ b/lib/mktime.c	Sun Jul 03 12:59:54 2016 +0200
@@ -470,6 +470,8 @@
      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);
--- a/m4/mktime.m4	Wed Jun 22 13:49:53 2016 +0100
+++ b/m4/mktime.m4	Sun Jul 03 12:59:54 2016 +0200
@@ -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 @@
   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.