From fe48f6ed6aff5572fbb2c093690ecf9b24248b86 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Fri, 26 Nov 1999 16:32:02 +0000 Subject: [PATCH] Use thread-safe versions of asctime and localtime --- main/main.c | 8 ++++---- 1 file 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)); } -- 2.40.0