1 --- perl-5.8.7/reentr.inc.161305 2005-11-03 12:56:58.000000000 -0500
2 +++ perl-5.8.7/reentr.inc 2005-11-03 12:58:16.000000000 -0500
3 @@ -1368,10 +1368,10 @@
6 # if !defined(localtime) && LOCALTIME_R_PROTO == REENTRANT_PROTO_S_TS
7 -# define localtime(a) (localtime_r(a, &PL_reentrant_buffer->_localtime_struct) ? &PL_reentrant_buffer->_localtime_struct : 0)
8 +# define localtime(a) ( L_R_TZSET localtime_r(a, &PL_reentrant_buffer->_localtime_struct) ? &PL_reentrant_buffer->_localtime_struct : 0)
10 # if !defined(localtime) && LOCALTIME_R_PROTO == REENTRANT_PROTO_I_TS
11 -# define localtime(a) (localtime_r(a, &PL_reentrant_buffer->_localtime_struct) == 0 ? &PL_reentrant_buffer->_localtime_struct : 0)
12 +# define localtime(a) ( L_R_TZSET localtime_r(a, &PL_reentrant_buffer->_localtime_struct) == 0 ? &PL_reentrant_buffer->_localtime_struct : 0)
14 #endif /* HAS_LOCALTIME_R */
16 --- perl-5.8.7/config_h.SH.161305 2005-04-30 10:34:20.000000000 -0400
17 +++ perl-5.8.7/config_h.SH 2005-11-03 12:58:16.000000000 -0500
18 @@ -1916,7 +1916,18 @@
20 #$d_localtime_r HAS_LOCALTIME_R /**/
21 #define LOCALTIME_R_PROTO $localtime_r_proto /**/
23 +/* LOCALTIME_R_NEEDS_TZSET :
24 + * many libc's localtime_r implementations do not call tzset,
25 + * making them differ from localtime(), and making timezone
26 + * changes using $ENV{TZ} without explicitly calling tzset
27 + * impossible. This symbol makes us call tzset before localtime_r:
29 +#$d_localtime_r_needs_tzset LOCALTIME_R_NEEDS_TZSET /**/
30 +#ifdef LOCALTIME_R_NEEDS_TZSET
31 +#define L_R_TZSET tzset(),
36 * This symbol will be defined if the C compiler supports long
38 --- perl-5.8.7/Configure.161305 2005-11-03 12:56:58.000000000 -0500
39 +++ perl-5.8.7/Configure 2005-11-03 13:13:54.000000000 -0500
44 +d_localtime_r_needs_tzset=''
48 @@ -14023,7 +14024,55 @@
49 *) localtime_r_proto=0
52 +: see if localtime_r calls tzset
53 +case "$localtime_r_proto" in
56 +/* Does our libc's localtime_r call tzset ?
57 + * return 0 if so, 1 otherwise.
59 +#include <sys/types.h>
66 + time_t t = time(0L);
67 + char w_tz[]="TZ=GMT+5",
69 + *tz_e = (char*)malloc(16),
70 + *tz_w = (char*)malloc(16);
71 + struct tm tm_e, tm_w;
77 + localtime_r(&t, &tm_e);
80 + localtime_r(&t, &tm_w);
82 + if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
88 + if eval $compile; then
90 + d_localtime_r_needs_tzset=undef;
92 + d_localtime_r_needs_tzset=define;
96 + d_localtime_r_needs_tzset=undef;
101 : see if localeconv exists
102 set localeconv d_locconv
104 @@ -20769,6 +20818,7 @@
105 d_libm_lib_version='$d_libm_lib_version'
107 d_localtime_r='$d_localtime_r'
108 +d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
109 d_locconv='$d_locconv'
111 d_longdbl='$d_longdbl'