From: foobar Date: Tue, 9 Jan 2001 09:02:21 +0000 (+0000) Subject: If TZ environment variable is changed call tzset(). X-Git-Tag: php-4.0.5RC1~654 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e247b206e07fddb7e6d34c5e67589c25d53d2782;p=php If TZ environment variable is changed call tzset(). # Although man page for tzset() says it should be called automaticly # by some of the time related functions, IRL this doesn't happen. # PR: 3977, 4732, 5510, 6972, 7203, 8502, 8609 --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index a59ed605f7..90f425b958 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1059,6 +1059,9 @@ PHP_FUNCTION(putenv) if ((ret=putenv(pe.putenv_string))==0) { /* success */ zend_hash_add(&BG(putenv_ht),pe.key,pe.key_len+1,(void **) &pe,sizeof(putenv_entry),NULL); +#ifdef HAVE_TZSET + if(!strncmp(pe.key,"TZ",2)) tzset(); +#endif RETURN_TRUE; } else { efree(pe.putenv_string);