[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
‘mktime’ replacement on glibc systems
From: |
Ludovic Courtès |
Subject: |
‘mktime’ replacement on glibc systems |
Date: |
Thu, 30 Jun 2016 10:21:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Hello Paul,
Gnulib’s ‘mktime’ replacement gets used on glibc systems (glibc 2.22
here) due to ‘__mktime_internal’ being unavailable, even though
gl_cv_func_working_mktime=yes on these systems. Is this intended?
Furthermore, lib/mktime.c has this:
--8<---------------cut here---------------start------------->8---
time_t
mktime (struct tm *tp)
{
#ifdef _LIBC
/* POSIX.1 8.1.1 requires that whenever mktime() is called, the
time zone names contained in the external variable 'tzname' shall
be set as if the tzset() function had been called. */
__tzset ();
#endif
return __mktime_internal (tp, __localtime_r, &localtime_offset);
}
--8<---------------cut here---------------end--------------->8---
I believe “#ifdef _LIBC” should be changed to something like:
--8<---------------cut here---------------start------------->8---
#ifdef _LIBC
__tzset ();
#else
tzset ();
#endif
--8<---------------cut here---------------end--------------->8---
otherwise the current ‘TZ’ variable value ends up being ignored (we
noticed this problem with Guile’s test suite.)
WDYT?
Thanks,
Ludo’.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- ‘mktime’ replacement on glibc systems,
Ludovic Courtès <=