summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2009-07-07 16:42:11 +0000
committerJani Taskinen <jani@php.net>2009-07-07 16:42:11 +0000
commit87f9d62861d39b4feaa1ffcbbb5eaa95b3fb71b9 (patch)
treeeac9b34f81145eefa0bd1e34f6c9d40203ed2758
parentc408f289be5b1bfcea205fd05127844642b3f9b7 (diff)
downloadphp-git-87f9d62861d39b4feaa1ffcbbb5eaa95b3fb71b9.tar.gz
- Fixed bug #48247 (Infinite loop and possible crash during startup with errors)
-rw-r--r--NEWS5
-rw-r--r--main/main.c34
2 files changed, 18 insertions, 21 deletions
diff --git a/NEWS b/NEWS
index 5540712125..a2414bd86d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,6 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2009, PHP 5.3.1
-
- Fixed spl_autoload_unregister/spl_autoad_functions wrt. Closures and
Functors. (Christian Seiler)
@@ -14,7 +13,9 @@ PHP NEWS
components). (Ilia)
- Fixed bug #48681 (openssl signature verification for tar archives broken).
(Greg)
-- Fixed #48116 (Fixed build with Openssl 1.0). (Pierre,
+- Fixed bug #48247 (Infinite loop and possible crash during startup with
+ errors when errors are logged). (Jani)
+- Fixed bug #48116 (Fixed build with Openssl 1.0). (Pierre,
Al dot Smith at aeschi dot ch dot eu dot org)
- Fixed bug #47351 (Memory leak in DateTime). (Derick, Tobias John)
- Fixed bug #45905 (imagefilledrectangle() clipping error).
diff --git a/main/main.c b/main/main.c
index 93cdfdfe3a..85258cf327 100644
--- a/main/main.c
+++ b/main/main.c
@@ -516,6 +516,20 @@ static int module_initialized = 0;
static int module_startup = 1;
static int module_shutdown = 0;
+/* {{{ php_during_module_startup */
+static int php_during_module_startup(void)
+{
+ return module_startup;
+}
+/* }}} */
+
+/* {{{ php_during_module_shutdown */
+static int php_during_module_shutdown(void)
+{
+ return module_shutdown;
+}
+/* }}} */
+
/* {{{ php_log_err
*/
PHPAPI void php_log_err(char *log_message TSRMLS_DC)
@@ -538,7 +552,7 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
char *error_time_str;
time(&error_time);
- error_time_str = php_format_date("d-M-Y H:i:s", 11, error_time, 1 TSRMLS_CC);
+ error_time_str = php_format_date("d-M-Y H:i:s", 11, error_time, php_during_module_startup() TSRMLS_CC);
len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL);
#ifdef PHP_WIN32
php_flock(fd, 2);
@@ -587,24 +601,6 @@ PHPAPI int php_printf(const char *format, ...)
}
/* }}} */
-/* {{{ php_verror helpers */
-
-/* {{{ php_during_module_startup */
-static int php_during_module_startup(void)
-{
- return module_startup;
-}
-/* }}} */
-
-/* {{{ php_during_module_shutdown */
-static int php_during_module_shutdown(void)
-{
- return module_shutdown;
-}
-/* }}} */
-
-/* }}} */
-
/* {{{ php_verror */
/* php_verror is called from php_error_docref<n> functions.
* Its purpose is to unify error messages and automatically generate clickable