Support socketpairs in proc_open()

Closes GH-5777.
This commit is contained in:
Martin Schröder 2020-07-12 20:56:47 +02:00 committed by Nikita Popov
parent 1a00d015be
commit 547d98b81d
10 changed files with 301 additions and 38 deletions

View file

@ -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
}