summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-08-07 23:35:20 +0000
committerZachary Turner <zturner@google.com>2014-08-07 23:35:20 +0000
commitcdc029d04b4122a1503072c5a56fe33f6191d806 (patch)
treeec868ffefc678feab65aac37958a5c7a0abc611f
parent9080920dedd66fde0d89a504de6d4ec272c96537 (diff)
downloadbcm5719-llvm-cdc029d04b4122a1503072c5a56fe33f6191d806.tar.gz
bcm5719-llvm-cdc029d04b4122a1503072c5a56fe33f6191d806.zip
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
-rw-r--r--lldb/source/Core/ConnectionFileDescriptor.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/source/Core/ConnectionFileDescriptor.cpp b/lldb/source/Core/ConnectionFileDescriptor.cpp
index ff89ce1df99..7c8e98a2112 100644
--- a/lldb/source/Core/ConnectionFileDescriptor.cpp
+++ b/lldb/source/Core/ConnectionFileDescriptor.cpp
@@ -591,12 +591,19 @@ 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())
{
const int nfds = std::max<int>(handle, pipe_fd) + 1;
OpenPOWER on IntegriCloud