Patches item #1096244, was opened at 2005-01-04 21:26
Message generated for change (Comment added) made by bcannon
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1096244&group_id=5470
Category: Build
Group: Python 2.4
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Gregory Bond (gnbond)
Assigned to: Brett Cannon (bcannon)
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: Brett Cannon (bcannon)
Date: 2005-02-10 14:47
Message:
Logged In: YES
user_id=357491
For configure.in, rev. 1.481 in 2.5 and rev. 1.475.2.6 in 2.4 have the fix.
Only modified the comments of your patch.
Thanks, Gregory!
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon)
Date: 2005-01-06 19:57
Message:
Logged In: YES
user_id=357491
Well, considering tzset can be called when HAVE_TZNAME is set it
definitely does not hurt to check it.
The patch basically looks good, but I don't have time right now for a
thorough check so I am not going to check it in right away. But it will
get in.
----------------------------------------------------------------------
Comment By: Gregory Bond (gnbond)
Date: 2005-01-06 17: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-06 16: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-05 23: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
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches