diff options
author | Anatol Belski <ab@php.net> | 2015-06-30 17:21:21 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2015-07-02 14:22:57 +0200 |
commit | d516a14fb93705ec03b39e611899a95bc0d591fe (patch) | |
tree | c1377d9607a397c2bca35818ee9f4f9692c24308 /ext/standard/php_fopen_wrapper.c | |
parent | 1a5a4d546ede8fcdf7a9cc4462858bfedf3644d9 (diff) | |
download | php-git-d516a14fb93705ec03b39e611899a95bc0d591fe.tar.gz |
properly set the pipe blocking option
Diffstat (limited to 'ext/standard/php_fopen_wrapper.c')
-rw-r--r-- | ext/standard/php_fopen_wrapper.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index c3bd4b0048..89e4a81c35 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -400,17 +400,19 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa if (stream == NULL) { close(fd); } + } + #ifdef PHP_WIN32 { - zval *blocking_pipes = php_stream_context_get_option(context, "pipe", "blocking"); - if (blocking_pipes) { - convert_to_long(blocking_pipes); - php_stream_set_option(stream, PHP_STREAM_OPTION_PIPE_BLOCKING, Z_LVAL_P(blocking_pipes), NULL); + if (stream && context) { + zval *blocking_pipes = php_stream_context_get_option(context, "pipe", "blocking"); + if (blocking_pipes) { + convert_to_long(blocking_pipes); + php_stream_set_option(stream, PHP_STREAM_OPTION_PIPE_BLOCKING, Z_LVAL_P(blocking_pipes), NULL); + } } } #endif - } - return stream; } /* }}} */ |