unsetenv() patch for TZ
Yaakov Selkowitz
yselkowi@redhat.com
Mon Mar 30 19:09:00 GMT 2015
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.
More information about the Newlib
mailing list