forked from OSchip/llvm-project
Disable the command pipe in ConnectionFileDescriptor for Windows.
The select() API on Windows is not compatible with objects other than sockets, so passing a descriptor for the command pipe to this function is guaranteed to fail. ConnectionFileDescriptor is still broken on Windows after this patch, but slightly less broken than before. llvm-svn: 215172
This commit is contained in:
parent
9080920ded
commit
cdc029d04b
|
@ -591,11 +591,18 @@ ConnectionFileDescriptor::BytesAvailable (uint32_t timeout_usec, Error *error_pt
|
|||
|
||||
if (handle != IOObject::kInvalidHandleValue)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
// select() won't accept pipes on Windows. The entire Windows codepath needs to be
|
||||
// converted over to using WaitForMultipleObjects and event HANDLEs, but for now at least
|
||||
// this will allow ::select() to not return an error.
|
||||
const bool have_pipe_fd = false;
|
||||
#else
|
||||
const bool have_pipe_fd = pipe_fd >= 0;
|
||||
#if !defined(__APPLE__) && !defined(_MSC_VER)
|
||||
#if !defined(__APPLE__)
|
||||
assert (handle < FD_SETSIZE);
|
||||
if (have_pipe_fd)
|
||||
assert (pipe_fd < FD_SETSIZE);
|
||||
#endif
|
||||
#endif
|
||||
while (handle == m_read_sp->GetWaitableHandle())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue