Force rereading TZDEFRULES after it was used to set DST rules only (bug #19253)
Commit Message
If the TZDEFRULES file was used to set the DST rules when $TZ didn't
provide any we need to make sure that the next time it is used we
recompute everything as __tzfile_default changes some setting from what is
provided by TZDEFRULES.
Andreas.
[BZ #19253]
* time/tzfile.c (__tzfile_default): Invalidate tzfile attribute
cache when TZDEFRULES was used.
---
time/tzfile.c | 6 ++++++
1 file changed, 6 insertions(+)
Comments
Is there some reason it's hard to add a test for this to the testsuite?
Joseph Myers <joseph@codesourcery.com> writes:
> Is there some reason it's hard to add a test for this to the testsuite?
It depends on TZDEFRULES on the host.
Andreas.
@@ -628,6 +628,12 @@ __tzfile_default (const char *std, const char *dst,
__timezone = -types[0].offset;
compute_tzname_max (stdlen + dstlen);
+
+ /* Invalidate the tzfile attribute cache to force rereading
+ TZDEFRULES the next time it is used. */
+ tzfile_dev = 0;
+ tzfile_ino = 0;
+ tzfile_mtime = 0;
}
void