cvs: php-src(PHP_5_3) /main main.c
| From: | Derick Rethans | Date: | Sun, 03 May 2009 19:08:49 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /main main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-57484@lists.php.net to get a copy of this message | ||
derick Sun May 3 19:08:49 2009 UTC
Modified files: (Branch: PHP_5_3)
/php-src/main main.c
Log:
- MFH: Fixed bug #45191 (error_log ignores date.timezone php.ini val when
setting logging timestamps).
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.57.2.49&r2=1.640.2.23.2.57.2.50&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.23.2.57.2.49 php-src/main/main.c:1.640.2.23.2.57.2.50
--- php-src/main/main.c:1.640.2.23.2.57.2.49 Thu Apr 30 09:11:00 2009
+++ php-src/main/main.c Sun May 3 19:08:49 2009
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.640.2.23.2.57.2.49 2009/04/30 09:11:00 pajoye Exp $ */
+/* $Id: main.c,v 1.640.2.23.2.57.2.50 2009/05/03 19:08:49 derick Exp $ */
/* {{{ includes
*/
@@ -520,7 +520,6 @@
PHPAPI void php_log_err(char *log_message TSRMLS_DC)
{
int fd = -1;
- char error_time_str[128];
struct tm tmbuf;
time_t error_time;
@@ -536,14 +535,17 @@
if (fd != -1) {
char *tmp;
int len;
+ char *error_time_str;
+
time(&error_time);
- strftime(error_time_str, sizeof(error_time_str), "%d-%b-%Y %H:%M:%S",
php_localtime_r(&error_time, &tmbuf));
+ error_time_str = php_format_date("d-M-Y H:i:s", 11, error_time, 1 TSRMLS_CC);
len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL);
#ifdef PHP_WIN32
php_flock(fd, 2);
#endif
write(fd, tmp, len);
efree(tmp);
+ efree(error_time_str);
close(fd);
return;
}