diff options
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/time/mktime.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |