diff options
| author | Sascha Schumann <sas@php.net> | 1999-11-26 16:32:02 +0000 |
|---|---|---|
| committer | Sascha Schumann <sas@php.net> | 1999-11-26 16:32:02 +0000 |
| commit | fe48f6ed6aff5572fbb2c093690ecf9b24248b86 (patch) | |
| tree | df1bbc319a16d6f6a1d44f46b990e397e37d4c03 | |
| parent | 1c6173619ebe6ae8fabfa45ce8658d98748a9b58 (diff) | |
| download | php-git-fe48f6ed6aff5572fbb2c093690ecf9b24248b86.tar.gz | |
Use thread-safe versions of asctime and localtime
| -rw-r--r-- | main/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/main/main.c b/main/main.c index 39907b0c27..ea358d7ce7 100644 --- a/main/main.c +++ b/main/main.c @@ -662,14 +662,14 @@ static void php_message_handler_for_zend(long message, void *data) } break; case ZMSG_LOG_SCRIPT_NAME: { - struct tm *ta; + struct tm *ta, tmbuf; time_t curtime; - char *datetime_str; + char *datetime_str, asctimebuf[52]; SLS_FETCH(); time(&curtime); - ta = localtime(&curtime); - datetime_str = asctime(ta); + ta = localtime_r(&curtime, &tmbuf); + datetime_str = asctime_r(ta, asctimebuf); datetime_str[strlen(datetime_str)-1]=0; /* get rid of the trailing newline */ fprintf(stderr, "[%s] Script: '%s'\n", datetime_str, SAFE_FILENAME(SG(request_info).path_translated)); } |
