This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: localtime and TZ

On 10/30/2010 8:58 AM, Ken Brown wrote:
I've looked at Cygwin's, 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)
		goto out;

So getting rid of 'if (!lcl_is_set)' would solve the problem.  But this
would be inefficient, because it would mean that tzsetwall gets called
every time tzset is called if TZ is never set.  To get around that, one
could have tzsetwall set TZ.

It seems that tzset and tzsetwall used to behave the way I'm proposing
before the following two changes were made:

2007-12-11 Corinna Vinschen<>

	* (tzset): Call tzsetwall only if it hasn't been
	called before.

2007-08-01 Corinna Vinschen<>

* (tzsetwall): Don't set TZ.

I've just found the reason for the 2007-08-01 change:

So I don't know what should be done.

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.


Attachment: tzset.patch
Description: Text document

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]