From d8bf8e1e8ad280542b4de90763d6d552c4f27b3a Mon Sep 17 00:00:00 2001 From: edwin Date: Tue, 23 Jun 2009 22:28:44 +0000 Subject: Remove duplicate if-statement on gmt_is_set in gmtsub(). MFC after: 1 week --- lib/libc/stdtime/localtime.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c index 83cecd1..e0ed73f 100644 --- a/lib/libc/stdtime/localtime.c +++ b/lib/libc/stdtime/localtime.c @@ -1472,18 +1472,16 @@ struct tm * const tmp; { register struct tm * result; + _MUTEX_LOCK(&gmt_mutex); if (!gmt_is_set) { - _MUTEX_LOCK(&gmt_mutex); - if (!gmt_is_set) { #ifdef ALL_STATE - gmtptr = (struct state *) malloc(sizeof *gmtptr); - if (gmtptr != NULL) + gmtptr = (struct state *) malloc(sizeof *gmtptr); + if (gmtptr != NULL) #endif /* defined ALL_STATE */ - gmtload(gmtptr); - gmt_is_set = TRUE; - } - _MUTEX_UNLOCK(&gmt_mutex); + gmtload(gmtptr); + gmt_is_set = TRUE; } + _MUTEX_UNLOCK(&gmt_mutex); result = timesub(timep, offset, gmtptr, tmp); #ifdef TM_ZONE /* -- cgit v1.1