diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-03-31 11:22:50 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-04-23 21:57:08 +0200 |
commit | b3a09ae34bd691c95bc41a594a40a808455d748a (patch) | |
tree | a5a692e255bbc1ee7473c4a5426e333e51858464 /newlib/libc/time/lcltime_r.c | |
parent | c11779332651dd2f3b12f5ec48202fa7e547272b (diff) | |
download | cygnal-b3a09ae34bd691c95bc41a594a40a808455d748a.tar.gz cygnal-b3a09ae34bd691c95bc41a594a40a808455d748a.tar.bz2 cygnal-b3a09ae34bd691c95bc41a594a40a808455d748a.zip |
Avoid excessive locking and calling tzset in time functions.
* libc/time/lcltime_r.c (localtime_r): Call _tzset_unlocked inside
TZ lock.
* libc/time/mktime.c (mktime): Ditto.
* libc/time/strftime.c (strftime, wcsftime): Ditto. Guard against
calling _tzset_unlocked more than once (baring recursion).
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libc/time/lcltime_r.c')
-rw-r--r-- | newlib/libc/time/lcltime_r.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libc/time/lcltime_r.c b/newlib/libc/time/lcltime_r.c index 8a69e40ee..3342e9906 100644 --- a/newlib/libc/time/lcltime_r.c +++ b/newlib/libc/time/lcltime_r.c @@ -31,8 +31,8 @@ _DEFUN (localtime_r, (tim_p, res), year = res->tm_year + YEAR_BASE; ip = __month_lengths[isleap(year)]; - tzset (); TZ_LOCK; + _tzset_unlocked (); if (_daylight) { if (year == tz->__tzyear || __tzcalc_limits (year)) |