Skip to content

Commit

Permalink
[BZ #5186]
Browse files Browse the repository at this point in the history
	* time/tzset.c (__tz_convert): Don't force testing for a change of
	TZ if not called from localtime.  But then also see whether the
	file changed, in case __use_tzfile is set.
  • Loading branch information
Ulrich Drepper committed Oct 17, 2007
1 parent 1aa5e4d commit 58423c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
2007-10-17 Ulrich Drepper <drepper@redhat.com>

[BZ #5186]
* time/tzset.c (__tz_convert): Don't force testing for a change of
TZ if not called from localtime. But then also see whether the
file changed, in case __use_tzfile is set.

* sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Define F_DUPFD_CLOEXEC.
* sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
Expand Down
7 changes: 3 additions & 4 deletions time/tzset.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ tzset_internal (always, explicit)
if (tz && *tz == ':')
++tz;

/* Check whether the value changes since the last run. */
/* Check whether the value changed since the last run. */
if (old_tz != NULL && tz != NULL && strcmp (tz, old_tz) == 0)
/* No change, simply return. */
return;
Expand Down Expand Up @@ -606,9 +606,8 @@ __tz_convert (const time_t *timer, int use_localtime, struct tm *tp)

/* Update internal database according to current TZ setting.
POSIX.1 8.3.7.2 says that localtime_r is not required to set tzname.
This is a good idea since this allows at least a bit more parallelism.
By analogy we apply the same rule to gmtime_r. */
tzset_internal (tp == &_tmbuf, 0);
This is a good idea since this allows at least a bit more parallelism. */
tzset_internal (tp == &_tmbuf && use_localtime, 1);

if (__use_tzfile)
__tzfile_compute (*timer, use_localtime, &leap_correction,
Expand Down

0 comments on commit 58423c7

Please sign in to comment.