* libc/time/mktime.c (mktime): Lock global timezone info while

accessing it.
This commit is contained in:
Corinna Vinschen 2011-06-27 10:13:11 +00:00
parent b9a5b2c45f
commit 7e055fdf39
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-06-25 Andreas Becker <becker@se-elektronic.de>
* libc/time/mktime.c (mktime): Lock global timezone info while
accessing it.
2011-06-14 Philip Munts <phil@munts.net>
* libc/time/asctime_r.c (asctime_r): Replace call to sprintf with call

View File

@ -208,6 +208,8 @@ _DEFUN(mktime, (tim_p),
tm_isdst = tim_p->tm_isdst > 0 ? 1 : tim_p->tm_isdst;
isdst = tm_isdst;
TZ_LOCK;
if (_daylight)
{
int y = tim_p->tm_year + YEAR_BASE;
@ -257,6 +259,8 @@ _DEFUN(mktime, (tim_p),
else /* otherwise assume std time */
tim += (time_t) tz->__tzrule[0].offset;
TZ_UNLOCK;
/* reset isdst flag to what we have calculated */
tim_p->tm_isdst = isdst;