From 801c353ac5392a1ff6749a3ea1ef1fe619cbc25d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 9 Sep 1997 01:45:55 +0000 Subject: Change for 2.0.5b --- time/tzset.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'time/tzset.c') diff --git a/time/tzset.c b/time/tzset.c index e0c39552ca..979a33b069 100644 --- a/time/tzset.c +++ b/time/tzset.c @@ -17,6 +17,7 @@ Boston, MA 02111-1307, USA. */ #include +#include #include #include #include @@ -44,6 +45,9 @@ weak_alias (__tzname, tzname) weak_alias (__daylight, daylight) weak_alias (__timezone, timezone) +/* This locks all the state variables in tzfile.c and this file. */ +__libc_lock_define (static, tzset_lock) + #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) @@ -430,8 +434,12 @@ size_t __tzname_cur_max; long int __tzname_max () { + __libc_lock_lock (tzset_lock); + __tzset_internal (0); + __libc_lock_unlock (tzset_lock); + return __tzname_cur_max; } @@ -552,18 +560,13 @@ __tz_compute (timer, tm) return 1; } -#include - -/* This locks all the state variables in tzfile.c and this file. */ -__libc_lock_define (, __tzset_lock) - /* Reinterpret the TZ environment variable and set `tzname'. */ #undef tzset void __tzset (void) { - __libc_lock_lock (__tzset_lock); + __libc_lock_lock (tzset_lock); __tzset_internal (1); @@ -574,6 +577,6 @@ __tzset (void) __tzname[1] = (char *) tz_rules[1].name; } - __libc_lock_unlock (__tzset_lock); + __libc_lock_unlock (tzset_lock); } weak_alias (__tzset, tzset) -- cgit v1.2.3