summaryrefslogtreecommitdiff
path: root/main/streams
diff options
context:
space:
mode:
authorMartin Schröder <m.schroeder2007@gmail.com>2020-07-12 20:56:47 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-07-14 10:35:45 +0200
commit547d98b81d674c48f04eab5c24aa065eba4838cc (patch)
treec74b563738e221d80224562c0c3a248f2e102ce1 /main/streams
parent1a00d015be4f5c1457146022c4d692a03d95154b (diff)
downloadphp-git-547d98b81d674c48f04eab5c24aa065eba4838cc.tar.gz
Support socketpairs in proc_open()
Closes GH-5777.
Diffstat (limited to 'main/streams')
-rw-r--r--main/streams/plain_wrapper.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index f33c65df68..b6db92ddad 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -257,6 +257,11 @@ static void detect_is_seekable(php_stdio_stream_data *self) {
self->is_seekable = !(file_type == FILE_TYPE_PIPE || file_type == FILE_TYPE_CHAR);
self->is_pipe = file_type == FILE_TYPE_PIPE;
+
+ /* Additional check needed to distinguish between pipes and sockets. */
+ if (self->is_pipe && !GetNamedPipeInfo((HANDLE) handle, NULL, NULL, NULL, NULL)) {
+ self->is_pipe = 0;
+ }
}
#endif
}