diff options
author | Martin Schröder <m.schroeder2007@gmail.com> | 2020-07-12 20:56:47 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-07-14 10:35:45 +0200 |
commit | 547d98b81d674c48f04eab5c24aa065eba4838cc (patch) | |
tree | c74b563738e221d80224562c0c3a248f2e102ce1 /main/streams | |
parent | 1a00d015be4f5c1457146022c4d692a03d95154b (diff) | |
download | php-git-547d98b81d674c48f04eab5c24aa065eba4838cc.tar.gz |
Support socketpairs in proc_open()
Closes GH-5777.
Diffstat (limited to 'main/streams')
-rw-r--r-- | main/streams/plain_wrapper.c | 5 |
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 } |