Module Name:    src
Committed By:   christos
Date:           Thu Jun 16 22:40:17 UTC 2011

Modified Files:
        src/lib/libc/time: localtime.c

Log Message:
don't modify tzname unless we are the non-reentrant version.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/lib/libc/time/localtime.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/localtime.c
diff -u src/lib/libc/time/localtime.c:1.56 src/lib/libc/time/localtime.c:1.57
--- src/lib/libc/time/localtime.c:1.56	Mon Feb 21 17:07:44 2011
+++ src/lib/libc/time/localtime.c	Thu Jun 16 18:40:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: localtime.c,v 1.56 2011/02/21 22:07:44 christos Exp $	*/
+/*	$NetBSD: localtime.c,v 1.57 2011/06/16 22:40:17 christos Exp $	*/
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
 #if 0
 static char	elsieid[] = "@(#)localtime.c	8.9";
 #else
-__RCSID("$NetBSD: localtime.c,v 1.56 2011/02/21 22:07:44 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.57 2011/06/16 22:40:17 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -1386,7 +1386,8 @@
 	*/
 	result = timesub(sp, &t, ttisp->tt_gmtoff, tmp);
 	tmp->tm_isdst = ttisp->tt_isdst;
-	tzname[tmp->tm_isdst] = &sp->chars[ttisp->tt_abbrind];
+	if (sp == lclptr)
+		tzname[tmp->tm_isdst] = &sp->chars[ttisp->tt_abbrind];
 #ifdef TM_ZONE
 	tmp->TM_ZONE = &sp->chars[ttisp->tt_abbrind];
 #endif /* defined TM_ZONE */

Reply via email to