diff options
Diffstat (limited to 'time')
-rw-r--r-- | time/tzfile.c | 6 | ||||
-rw-r--r-- | time/tzset.c | 17 |
2 files changed, 13 insertions, 10 deletions
diff --git a/time/tzfile.c b/time/tzfile.c index 88e86e33b1..c90e05749f 100644 --- a/time/tzfile.c +++ b/time/tzfile.c @@ -112,8 +112,8 @@ __tzfile_read (const char *file) /* No user specification; use the site-wide default. */ file = TZDEFAULT; else if (*file == '\0') - /* User specified the empty string; use UTC explicitly. */ - file = "Universal"; + /* User specified the empty string; use UTC with no leap seconds. */ + return; else { /* We must not allow to read an arbitrary file in a setuid @@ -455,7 +455,7 @@ __tzfile_compute (time_t timer, long int *leap_correct, int *leap_hit) return 1; } -void +static void compute_tzname_max (size_t chars) { extern size_t __tzname_cur_max; /* Defined in 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 <ctype.h> +#include <libc-lock.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> @@ -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 <libc-lock.h> - -/* 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) |