diff options
author | edwin <edwin@FreeBSD.org> | 2009-06-23 22:28:44 +0000 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2009-06-23 22:28:44 +0000 |
commit | d8bf8e1e8ad280542b4de90763d6d552c4f27b3a (patch) | |
tree | ae789249d9f2441aa44f4b1fbd1488b81fac377f | |
parent | daf61e7b90caa82bf71529387b20f823971b0e43 (diff) | |
download | FreeBSD-src-d8bf8e1e8ad280542b4de90763d6d552c4f27b3a.zip FreeBSD-src-d8bf8e1e8ad280542b4de90763d6d552c4f27b3a.tar.gz |
Remove duplicate if-statement on gmt_is_set in gmtsub().
MFC after: 1 week
-rw-r--r-- | lib/libc/stdtime/localtime.c | 14 |
1 files 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 /* |