>From 913c424ef1a10bacf63597ca7565b29908d6135b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 3 Jul 2016 12:59:54 +0200 Subject: [PATCH] mktime: call tzset as per POSIX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | 8 ++++++++ lib/mktime.c | 2 ++ m4/mktime.m4 | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 34b651f..ef33268 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2016-07-03 Paul Eggert + + 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 fts: handle readdir() errors diff --git a/lib/mktime.c b/lib/mktime.c index 87ab633..9eb3e76 100644 --- a/lib/mktime.c +++ b/lib/mktime.c @@ -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); diff --git a/m4/mktime.m4 b/m4/mktime.m4 index 5a0f2d8..23cad73 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -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. -- 2.5.5