Don't depend on lcl_mutex being a recursive mutex.
authorPeter Avalos <pavalos@theshell.com>
Thu, 15 Jan 2009 15:48:06 +0000 (10:48 -0500)
committerPeter Avalos <pavalos@theshell.com>
Tue, 7 Apr 2009 07:08:28 +0000 (21:08 -1000)
lib/libc/stdtime/localtime.c

index bf92bc9..b698f08 100644 (file)
@@ -1118,7 +1118,7 @@ tzset_basic(void)
 
        name = getenv("TZ");
        if (name == NULL) {
-               tzsetwall();
+               tzsetwall_basic();
                return;
        }
 
@@ -1254,7 +1254,7 @@ struct tm *
 localtime_r(const time_t * const timep, struct tm *p_tm)
 {
        _MUTEX_LOCK(&lcl_mutex);
-       tzset();
+       tzset_basic();
        localsub(timep, 0L, p_tm);
        _MUTEX_UNLOCK(&lcl_mutex);
        return(p_tm);
@@ -1284,12 +1284,12 @@ localtime(const time_t * const timep)
                        _pthread_setspecific(localtime_key, p_tm);
                }
                _pthread_mutex_lock(&lcl_mutex);
-               tzset();
+               tzset_basic();
                localsub(timep, 0L, p_tm);
                _pthread_mutex_unlock(&lcl_mutex);
                return(p_tm);
        } else {
-               tzset();
+               tzset_basic();
                localsub(timep, 0L, &tm);
                return(&tm);
        }
@@ -1869,7 +1869,7 @@ mktime(struct tm * const tmp)
 {
        time_t mktime_return_value;
        _MUTEX_LOCK(&lcl_mutex);
-       tzset();
+       tzset_basic();
        mktime_return_value = time1(tmp, localsub, 0L);
        _MUTEX_UNLOCK(&lcl_mutex);
        return(mktime_return_value);