This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: unsetenv() patch for TZ
- From: Yaakov Selkowitz <yselkowi at redhat dot com>
- To: newlib at sourceware dot org
- Date: Mon, 30 Mar 2015 13:34:15 -0500
- Subject: Re: unsetenv() patch for TZ
- Authentication-results: sourceware.org; auth=none
- References: <3862C5643B15B6468269546753EB2A92055821DD at BLTSXVS01 dot govsolutions dot com> <20110709121946 dot GM4726 at calimero dot vinschen dot de> <51B1001E dot 9000805 at LGSInnovations dot com> <20130607102308 dot GA32420 at calimero dot vinschen dot de> <55196E10 dot 7050705 at LGSInnovations dot com>
On Mon, 2015-03-30 at 11:38 -0400, Craig Howland wrote:
> OK. While I disagree that this is the best approach, it is your
> prerogative and attached is a patch for the
> ctime()/localtime()/mktime()/strftime() approach. It does have the benefit of
> also fixing the problem identified by Yaakov in "[PATCH] strftime: use tzname if
> TM_ZONE is NULL" (https://sourceware.org/ml/newlib/2015/msg00321.html).
My patch would still be needed as posted, this just takes care of the
additional questions posted therein.
> Since ctime() calls localtime(), it is not directly patched (i.e. the
> patch only directly adds to 3 of the 4 functions mentioned). The strftime.c
> patch also gets the wcsftime() function due to the shared source.
> I made a minor size/efficiency call in strftime(), and put in two tzset()
> calls, one for %z and one for %Z, so that tzset() will only be called if it is
> needed, at the expense of one more function call in the overall size. (Which is
> what Corinna says GLIBC does.0
Corinna also mentioned that it was guarded from multiple invocations by
what sounded like a local variable.
--
Yaakov Selkowitz
Associate Software Engineer, ARM
Red Hat, Inc.