* libc/time/mktime.c (mktime): Lock global timezone info while
accessing it.
This commit is contained in:
parent
b9a5b2c45f
commit
7e055fdf39
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue