[Patches] [ python-Patches-1096244 ] time.tzset() not built on Solaris

SourceForge.net noreply at sourceforge.net
Fri Jan 7 02:44:03 CET 2005


Patches item #1096244, was opened at 2005-01-05 16:26
Message generated for change (Comment added) made by gnbond
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1096244&group_id=5470

Category: Build
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Gregory Bond (gnbond)
Assigned to: Nobody/Anonymous (nobody)
Summary: time.tzset() not built on Solaris

Initial Comment:
The time.tzset() function is not included in Solaris
builds, because the code in configure.in that checks
for the existence of tzset() relies on struct tm having
a tm_zone member - which Solaris does not have (at
least not up to 2.8).

The attached patch to configure.in allows Solaris to
detect the existence of tzset() and Python builds OK,
and the resulting time.tzset() function seems to work
just fine.

diff -u configure.in.DIST configure.in
--- configure.in.DIST   2005-01-05 16:25:24.830001000 +1100
+++ configure.in        2005-01-05 16:25:38.227000000 +1100
@@ -2912,10 +2912,6 @@
        tzset();
        if (localtime(&groundhogday)->tm_hour != 11)
            exit(1);
-       if (strcmp(localtime(&groundhogday)->tm_zone,
"AEDT"))
-           exit(1);
-       if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
-           exit(1);
 
        exit(0);
 }


----------------------------------------------------------------------

>Comment By: Gregory Bond (gnbond)
Date: 2005-01-07 12:44

Message:
Logged In: YES 
user_id=293157

I've added  second patch with more comprehensive diffs that
also checks whether tzset() affects tzname[] (for those
systems without tm_zone).  This may be considered overkill!


----------------------------------------------------------------------

Comment By: Gregory Bond (gnbond)
Date: 2005-01-07 11:56

Message:
Logged In: YES 
user_id=293157

Hmm, I'm no autoconf guru, but try the attached patch.  It
seems to do the right thing on Solaris (tzset but no
tm_zone) and FreeBSD (tzset and tm_zone).

Amazing what you can find with half an hour of Google!

----------------------------------------------------------------------

Comment By: Brett Cannon (bcannon)
Date: 2005-01-06 18:26

Message:
Logged In: YES 
user_id=357491

But that fix removes a sanity check to detect broken tzset 
implementations.

Is there a similar way to check on Solaris to make sure tzset is not 
broken?  If so resubmit a patch (I reclassified this tracker item 
appropriately) that makes the test conditional on Solaris. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1096244&group_id=5470


More information about the Patches mailing list