]> granicus.if.org Git - php/commitdiff
MFH
authorAntony Dovgal <tony2001@php.net>
Thu, 22 Feb 2007 10:06:22 +0000 (10:06 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 22 Feb 2007 10:06:22 +0000 (10:06 +0000)
sapi/cli/php_cli.c

index e7dcef33f3e6b28d8981d7f8bb45fbb693e9793d..192f8876a3841549c2b59b233657a33020de7133 100644 (file)
@@ -476,12 +476,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);
@@ -491,7 +485,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);