cvs: /php4 main.c
| From: | Sascha Schumann | Date: | Fri, 26 Nov 1999 16:32:33 +0000 |
| Subject: | cvs: /php4 main.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-6934@lists.php.net to get a copy of this message | ||
sas Fri Nov 26 11:32:33 1999 EDT
Modified files:
/php4 main.c
Log:
Use thread-safe versions of asctime and localtime
Index: php4/main.c
diff -u php4/main.c:1.139 php4/main.c:1.140
--- php4/main.c:1.139 Thu Nov 25 10:24:49 1999
+++ php4/main.c Fri Nov 26 11:32:02 1999
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.139 1999/11/25 15:24:49 zeev Exp $ */
+/* $Id: main.c,v 1.140 1999/11/26 16:32:02 sas Exp $ */
#include <stdio.h>
@@ -662,14 +662,14 @@
}
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));
}