Fixed bug #38488 (Access to "php://stdin" and family crashes PHP on win32)

This commit is contained in:
Dmitry Stogov 2006-08-22 06:15:45 +00:00
parent b590503bdf
commit d824f02ce1

View File

@ -194,10 +194,9 @@ PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const cha
#elif defined(PHP_WIN32) #elif defined(PHP_WIN32)
{ {
long handle = _get_osfhandle(self->fd); long handle = _get_osfhandle(self->fd);
DWORD in_buf_size, out_buf_size;
if (handle != 0xFFFFFFFF) { if (handle != 0xFFFFFFFF) {
self->is_pipe = GetNamedPipeInfo((HANDLE)handle, NULL, &out_buf_size, &in_buf_size, NULL); self->is_pipe = GetFileType((HANDLE)handle) == FILE_TYPE_PIPE;
} }
} }
#endif #endif