* zdump.c (adjusted_yday, gmtoff): New functions.
(show): Use new function gmtoff to output gmtoff= even on
platforms that do not define TM_GMTOFF.
* NEWS: Document this.
localtime_rz does not need to lock, but gmtime does.
* zdump.c (gmtime_r) [!HAVE_LOCALTIME_R]: New function.
(USE_LOCALTIME_RZ): New macro. Use it to simplify ifdef usage.
(gmtz): New static var.
(gmtzinit, my_gmtime_r): New functions.
(main): Use them.
We don't know of any problems with the previous code on practical
platforms, but it's safer to be portable.
Problem reported by Andy Heninger in:
http://mm.icann.org/pipermail/tz/2014-September/021599.html
* localtime.c (VOLATILE): Remove. All uses removed.
(gmtcheck): Don't access gmt_is_set until we have the lock.
This may be significantly slower, but it's safer.
(localtime_tzset): Likewise. This change isn't significantly
slower, though; it's more of a refactoring.
* NEWS: Document this.
Problem reported by Tim Parenti in:
http://mm.icann.org/pipermail/tz/2014-September/021585.html
* zdump.c (localtime_r, localtime_rz) [!TM_ZONE]:
Just call 'localtime', since this can set tzname in a
timestamp-dependent way, which is better for zdump.
* NEWS: Document this.
In 2014g, localtime and mktime set tzname[0] and tzname[1] as if by
tzset, regardless of the requested time stamp. In 2014f and earlier,
localtime and mktime then set tzname[0] or tzname[1] to a time zone
appropriate for the time stamp in question.
Although both behaviors conform to POSIX, the 2014f behavior is
better because it lets a single-threaded application discover the
time zone abbreviation appropriate for the just-queried time stamp
even on platforms that lack TM_ZONE. The 2014f-and-earlier zdump
relies on the 2014f library behavior on these platforms.
Problem reported by Tim Parenti in:
http://mm.icann.org/pipermail/tz/2014-September/021585.html
* localtime.c (localsub): Treat a nonzero offset value
as a request to set tzname on success. All callers changed.
(localtime_rz, mktime_z): Define only if NETBSD_INSPIRED,
as they're no longer needed otherwise.
(localtime_tzset): Invert sense of third arg from SKIP_TZSET
to SETTZ. New arg SETNAME. All callers changed.
(localtime): Request tzname to be set on success.
(mktime_tzname): New function, with most of the previous
contents of mktime_z.
(mktime_z, mktime): Use it.
* NEWS: Document the above.
* africa (Africa/Blantyre, Africa/Bujumbura, Africa/Gaborone)
(Africa/Harare, Africa/Kigali, Africa/Lubumbashi, Africa/Lusaka):
Change these from zones to links to Africa/Maputo.
(Africa/Maseru, Africa/Mbabane):
Change these from zones to links to Africa/Johannesburg.
* backzone: Move the old data here.
* checktab.awk (tztab): Remove special cases for these zones.
* NEWS: Document the above.
Lack of documentation reported by Jonathan Lennox in:
http://mm.icann.org/pipermail/tz/2014-August/021529.html
* newtzset.3: Document tzalloc and tzfree.
* newctime.3: Document localtime_rz and mktime_z.
* NEWS: Mention this.
Suggested by Jonathan Lennox in:
http://mm.icann.org/pipermail/tz/2014-August/021529.html
* localtime.c (tzalloc): Treat NULL argument like tzsetwall.
(tzsetwall_unlocked): Remove, replacing with ...
(tzsetlcl): New function, which merges the old tzsetwall and
tzset_unlocked.
(zoneinit): Treat a null NAME like tzsetwall.
(tzsetwall, tzset_unlocked): Rewrite to use tzsetlcl.
* NEWS: Document this.
These don't fix any bugs, but make the recently-introduced 'bool'
code easier to follow.
* localtime.c (gmtcheck): Move gmt_is_set's definition here,
since it's used only here.
(localtime_r): Explicitly convert integer to boolean rather
than relying on C99 semantics.
This is mostly for convenience, so that plain 'make' works out of
the box on Solaris, instead of having to run something awkward like
'make CFLAGS="-xc99=all -DHAVE_INCOMPATIBLE_CTIME_R=1"', and
similarly for Irix 6.5.
* private.h (_POSIX_PTHREAD_SEMANTICS):
* private.h, zdump.c (__EXTENSIONS__):
New macros, to make Solaris headers more like what we want out
of the box.
(LLONG_MAX, LLONG_MIN): Default from __LONG_LONG_MAX__ if it's defined.
This simplifies later code.
(SCNdFAST64, PRIdMAX): Don't assume they're defined when
INT_FAST64_MAX is, as that's not true on Solaris 10 + Sun C 5.12.
(PRIuMAX): Likewise, for Solaris 11 + Sun C 5.12.
* zdump.c (HAVE_LOCALTIME_RZ): Default to 1 only if TM_ZONE.
* Makefile, NEWS: Document this.