Re: localtime and TZ

2010-10-30 Thread Ken Brown
On 10/30/2010 3:24 PM, Christopher Faylor wrote: This should be fixed in the next snapshot. Confirmed. Thanks. And this fixes the timezone bug that's described in /usr/share/doc/Cygwin/emacs.README. The workaround given there (defining TZ before starting emacs) is no longer necessary. Ke

Re: localtime and TZ

2010-10-30 Thread Christopher Faylor
On Sat, Oct 30, 2010 at 01:53:11PM -0400, Ken Brown wrote: >How's the attached patch? I'm not set up to build cygwin1.dll, so I >can't test it right now. I hope the intent is clear in case I got >something wrong. That would do it, yes. I chose to just track the initialization state in lcl_is_

Re: localtime and TZ

2010-10-30 Thread Ken Brown
On 10/30/2010 8:58 AM, Ken Brown wrote: I've looked at Cygwin's localtime.cc, and the behavior I'm complaining about is caused by the following code at the beginning of tzset: const char *name = getenv("TZ"); if (name == NULL) { if (!lcl_is_set)

Re: localtime and TZ

2010-10-30 Thread Ken Brown
On 10/30/2010 8:43 AM, Ken Brown wrote: On 10/29/2010 7:17 PM, Ken Brown wrote: On 10/29/2010 6:16 PM, Eric Blake wrote: On 10/29/2010 04:11 PM, Ken Brown wrote: Thanks, Eric. I didn't know about any of this. (I was using a modification of a configure test from the emacs sources.) Probab

Re: localtime and TZ

2010-10-30 Thread Ken Brown
On 10/29/2010 7:17 PM, Ken Brown wrote: On 10/29/2010 6:16 PM, Eric Blake wrote: On 10/29/2010 04:11 PM, Ken Brown wrote: Thanks, Eric. I didn't know about any of this. (I was using a modification of a configure test from the emacs sources.) Probably worth pointing it out to the emacs ups

Re: localtime and TZ

2010-10-29 Thread Ken Brown
On 10/29/2010 6:16 PM, Eric Blake wrote: On 10/29/2010 04:11 PM, Ken Brown wrote: Thanks, Eric. I didn't know about any of this. (I was using a modification of a configure test from the emacs sources.) Probably worth pointing it out to the emacs upstream, then :) But I get the same beh

Re: localtime and TZ

2010-10-29 Thread Eric Blake
On 10/29/2010 04:11 PM, Ken Brown wrote: > > Thanks, Eric. I didn't know about any of this. (I was using a modification > of a configure test from the emacs sources.) Probably worth pointing it out to the emacs upstream, then :) > But I get the same behavior with the following revised test c

Re: localtime and TZ

2010-10-29 Thread Ken Brown
On 10/29/2010 5:58 PM, Eric Blake wrote: > On 10/29/2010 03:54 PM, Eric Blake wrote: >> On 10/29/2010 03:44 PM, Ken Brown wrote: >>> While trying to debug a timezone problem in the Cygwin build of emacs, I've >>> come across a difference between Cygwin and Linux in the behavior of >>> localtime w

Re: localtime and TZ

2010-10-29 Thread Eric Blake
On 10/29/2010 03:54 PM, Eric Blake wrote: > On 10/29/2010 03:44 PM, Ken Brown wrote: >> While trying to debug a timezone problem in the Cygwin build of emacs, I've >> come across a difference between Cygwin and Linux in the behavior of >> localtime with respect to TZ. Suppose I set TZ, call loca

Re: localtime and TZ

2010-10-29 Thread Eliot Moss
Dear Ken -- You've described a *difference*, but it's not clear to me that it's a *bug*. Some run-time libraries cache values and some don't ... Now if the Posix spec says it *must* act a particular way and cygwin has it wrong, that's a bit of a different story Regards -- Eliot Moss -- P

Re: localtime and TZ

2010-10-29 Thread Eric Blake
On 10/29/2010 03:44 PM, Ken Brown wrote: > While trying to debug a timezone problem in the Cygwin build of emacs, I've > come across a difference between Cygwin and Linux in the behavior of > localtime with respect to TZ. Suppose I set TZ, call localtime, unset TZ, > and call localtime again.

localtime and TZ

2010-10-29 Thread Ken Brown
While trying to debug a timezone problem in the Cygwin build of emacs, I've come across a difference between Cygwin and Linux in the behavior of localtime with respect to TZ. Suppose I set TZ, call localtime, unset TZ, and call localtime again. On Cygwin, the second call to localtime re-uses t