Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-06-27 14:13:11 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-06-27 14:13:11 +0400
commit7e055fdf3938affa8b2156f614221b6f20ec9efb (patch)
treeb1cad7402e0cacc7d13938e10fee703fd8269545 /newlib
parentb9a5b2c45f70c7b85e17557a4050a198d3b805d6 (diff)
* libc/time/mktime.c (mktime): Lock global timezone info while
accessing it.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/time/mktime.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index cc2926b2d..2c7ecc7ea 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -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
diff --git a/newlib/libc/time/mktime.c b/newlib/libc/time/mktime.c
index d75d7cc85..acd5d3aa0 100644
--- a/newlib/libc/time/mktime.c
+++ b/newlib/libc/time/mktime.c
@@ -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;