diff options
author | Xinchen Hui <laruence@gmail.com> | 2016-08-17 16:56:02 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2016-08-17 16:56:02 +0800 |
commit | 3956deb1b20f8f7a9cabb3015cb3c9bb79fbf0be (patch) | |
tree | 0ae6df1d0f133795c8254aa7a7dd57b1753dac2e /main/streams | |
parent | ed9d916c28b042d276a28998f92eb7e6cc56025a (diff) | |
parent | abe00908afa2b7227cfd601ee948ff3b57c27eb7 (diff) | |
download | php-git-3956deb1b20f8f7a9cabb3015cb3c9bb79fbf0be.tar.gz |
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
Fixed bug #72853 (stream_set_blocking doesn't work)
Conflicts:
main/streams/plain_wrapper.c
Diffstat (limited to 'main/streams')
-rw-r--r-- | main/streams/plain_wrapper.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index d510c909a7..140e5e1fcd 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -851,7 +851,19 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void data->is_pipe_blocking = value; return PHP_STREAM_OPTION_RETURN_OK; #endif + case PHP_STREAM_OPTION_META_DATA_API: + if (fd == -1) + return -1; +#ifdef O_NONBLOCK + flags = fcntl(fd, F_GETFL, 0); + add_assoc_bool((zval*)ptrparam, "timed_out", 0); + add_assoc_bool((zval*)ptrparam, "blocked", (flags & O_NONBLOCK)? 0 : 1); + add_assoc_bool((zval*)ptrparam, "eof", stream->eof); + + return PHP_STREAM_OPTION_RETURN_OK; +#endif + return -1; default: return PHP_STREAM_OPTION_RETURN_NOTIMPL; } |