summaryrefslogtreecommitdiff
path: root/main/streams
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2016-08-17 16:56:02 +0800
committerXinchen Hui <laruence@gmail.com>2016-08-17 16:56:02 +0800
commit3956deb1b20f8f7a9cabb3015cb3c9bb79fbf0be (patch)
tree0ae6df1d0f133795c8254aa7a7dd57b1753dac2e /main/streams
parented9d916c28b042d276a28998f92eb7e6cc56025a (diff)
parentabe00908afa2b7227cfd601ee948ff3b57c27eb7 (diff)
downloadphp-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.c12
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;
}