From: Antony Dovgal Date: Thu, 22 Feb 2007 10:06:02 +0000 (+0000) Subject: check for NULL, then add flag X-Git-Tag: RELEASE_1_0_1~184 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30239ea383462ef30ceb2547eb4bb47e88bae2ce;p=php check for NULL, then add flag --- diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 33231445c2..4176ebb082 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -487,12 +487,6 @@ static void cli_register_file_handles(TSRMLS_D) s_out = php_stream_open_wrapper_ex("php://stdout", "wb", 0, NULL, sc_out); s_err = php_stream_open_wrapper_ex("php://stderr", "wb", 0, NULL, sc_err); -#if PHP_DEBUG - /* do not close stdout and stderr */ - s_out->flags |= PHP_STREAM_FLAG_NO_CLOSE; - s_err->flags |= PHP_STREAM_FLAG_NO_CLOSE; -#endif - if (s_in==NULL || s_out==NULL || s_err==NULL) { FREE_ZVAL(zin); FREE_ZVAL(zout); @@ -502,7 +496,13 @@ static void cli_register_file_handles(TSRMLS_D) if (s_err) php_stream_close(s_err); return; } - + +#if PHP_DEBUG + /* do not close stdout and stderr */ + s_out->flags |= PHP_STREAM_FLAG_NO_CLOSE; + s_err->flags |= PHP_STREAM_FLAG_NO_CLOSE; +#endif + s_in_process = s_in; php_stream_to_zval(s_in, zin);