From c2f7c3e4893b6b5c4494d549b3645e06664bc1b1 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 5 Feb 1997 23:26:09 +0000 Subject: Submitted by: John Birrell uthreads update from the author. --- lib/libc/stdtime/localtime.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/libc/stdtime/localtime.c') diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c index 5fe9f98..3438cc6 100644 --- a/lib/libc/stdtime/localtime.c +++ b/lib/libc/stdtime/localtime.c @@ -1109,12 +1109,10 @@ const time_t * const timep; } } pthread_mutex_unlock(&localtime_mutex); - if ((p_tm = pthread_getspecific(localtime_key)) != 0) { - return(NULL); - } else if (p_tm == NULL) { - if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) { + p_tm = pthread_getspecific(localtime_key); + if (p_tm == NULL) { + if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) return(NULL); - } pthread_setspecific(localtime_key, p_tm); } pthread_mutex_lock(&lcl_mutex); -- cgit v1.1