Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/time don't modify tzname unless we are the non-reen...



details:   https://anonhg.NetBSD.org/src/rev/519fbe862fc6
branches:  trunk
changeset: 766143:519fbe862fc6
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 16 22:40:17 2011 +0000

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

diffstat:

 lib/libc/time/localtime.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 5aacb10fec4a -r 519fbe862fc6 lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Thu Jun 16 21:53:53 2011 +0000
+++ b/lib/libc/time/localtime.c Thu Jun 16 22:40:17 2011 +0000
@@ -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 */



Home | Main Index | Thread Index | Old Index