summaryrefslogtreecommitdiff
path: root/lib/libc/stdtime/localtime.c
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1997-02-05 23:26:09 +0000
committerJulian Elischer <julian@FreeBSD.org>1997-02-05 23:26:09 +0000
commitc840cec7c5df4547d37d9ca025553099b834c1aa (patch)
treeb2e6d3017e236268263978b585f2150cd10b1689 /lib/libc/stdtime/localtime.c
parent3b576b3e5eac153732d10d222cc023a02adc3db7 (diff)
Notes
Diffstat (limited to 'lib/libc/stdtime/localtime.c')
-rw-r--r--lib/libc/stdtime/localtime.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c
index 5fe9f9845f28..3438cc673e72 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);