|
| From: | Jim Meyering |
| Subject: | Re: [Bug-gnulib] Re: access to Solaris2.5 system? [Re: strftime merge from Emacs |
| Date: | Mon, 09 Jun 2003 09:06:18 +0200 |
Paul Eggert <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>
>> +/* This is a wrapper for tzset. It is used only on systems for which
>> + tzset may clobber the static buffer used for localtime's result.
>> + Save and restore the contents of the buffer used for localtime's
>> + result around the call to tzset. */
>> +void
>> +rpl_tzset (void)
>> +{
>> + struct tm save;
>> +
>> + if (! localtime_buffer_addr)
>> + {
>> + time_t t = 0;
>> + localtime_buffer_addr = localtime (&t);
>> + }
>> +
>> + save = *localtime_buffer_addr;
>> + tzset ();
>> + *localtime_buffer_addr = save;
>> }
>
> Don't we still have the problem the first time that rpl_tzset is
> called? rpl_tzset still clobbers the localtime buffer in that case.
Yes, but who could be using it if no one has called localtime yet?
| [Prev in Thread] | Current Thread | [Next in Thread] |