Date: Tue, 23 Jun 2009 22:28:45 +0000 (UTC) From: Edwin Groothuis <edwin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r194783 - head/lib/libc/stdtime Message-ID: <200906232228.n5NMSjH8092835@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: edwin Date: Tue Jun 23 22:28:44 2009 New Revision: 194783 URL: http://svn.freebsd.org/changeset/base/194783 Log: Remove duplicate if-statement on gmt_is_set in gmtsub(). MFC after: 1 week Modified: head/lib/libc/stdtime/localtime.c Modified: head/lib/libc/stdtime/localtime.c ============================================================================== --- head/lib/libc/stdtime/localtime.c Tue Jun 23 22:22:20 2009 (r194782) +++ head/lib/libc/stdtime/localtime.c Tue Jun 23 22:28:44 2009 (r194783) @@ -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 /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906232228.n5NMSjH8092835>