summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/main.c8
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));
}