diff options
author | Zeev Suraski <zeev@php.net> | 2001-05-07 22:00:13 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2001-05-07 22:00:13 +0000 |
commit | ff11c36dc52582bae26e4572cce285b088db1ea6 (patch) | |
tree | 544c3ec95ad3bd5d35cb4ca7faf151d3c29026d7 | |
parent | a7bff5d8f1f04bef9ff35cb59fcb7b0a6e1d80cd (diff) | |
download | php-git-ff11c36dc52582bae26e4572cce285b088db1ea6.tar.gz |
Avoid crashing if somehow, output is sent in a new thread tha had no requests
-rw-r--r-- | ext/standard/output.c | 10 | ||||
-rw-r--r-- | main/output.c | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/ext/standard/output.c b/ext/standard/output.c index aa2b434450..d5862ad5a7 100644 --- a/ext/standard/output.c +++ b/ext/standard/output.c @@ -43,10 +43,16 @@ int output_globals_id; php_output_globals output_globals; #endif +static php_default_output_func(const char *str, uint str_len) +{ + fwrite(str, 1, str_len, stderr); +} + + static void php_output_init_globals(OLS_D) { - OG(php_body_write) = NULL; - OG(php_header_write) = NULL; + OG(php_body_write) = php_default_output_func; + OG(php_header_write) = php_default_output_func; OG(implicit_flush) = 0; OG(output_start_filename) = NULL; OG(output_start_lineno) = 0; diff --git a/main/output.c b/main/output.c index aa2b434450..d5862ad5a7 100644 --- a/main/output.c +++ b/main/output.c @@ -43,10 +43,16 @@ int output_globals_id; php_output_globals output_globals; #endif +static php_default_output_func(const char *str, uint str_len) +{ + fwrite(str, 1, str_len, stderr); +} + + static void php_output_init_globals(OLS_D) { - OG(php_body_write) = NULL; - OG(php_header_write) = NULL; + OG(php_body_write) = php_default_output_func; + OG(php_header_write) = php_default_output_func; OG(implicit_flush) = 0; OG(output_start_filename) = NULL; OG(output_start_lineno) = 0; |