diff options
author | Edwin Groothuis <edwin@FreeBSD.org> | 2009-06-23 22:28:44 +0000 |
---|---|---|
committer | Edwin Groothuis <edwin@FreeBSD.org> | 2009-06-23 22:28:44 +0000 |
commit | 9cf330555af80a6578384b84bcc2c0fa6d11a641 (patch) | |
tree | ae789249d9f2441aa44f4b1fbd1488b81fac377f | |
parent | d037d7aed622faee47ee1e157f85a8a141316cd3 (diff) |
Notes
-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 83cecd17c351..e0ed73f7d96f 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 /* |