[Lldb-commits] [lldb] r148616 - /lldb/trunk/source/Core/ConnectionFileDescriptor.cpp

Jim Ingham jingham at apple.com
Fri Jan 20 18:03:41 PST 2012


Author: jingham
Date: Fri Jan 20 20:03:41 2012
New Revision: 148616

URL: http://llvm.org/viewvc/llvm-project?rev=148616&view=rev
Log:
Our Read functions were taking a timeout of UINT32_MAX to mean wait forever, but then
we didn't implement that in setting the socket option.
<rdar://problem/10711649>

Modified:
    lldb/trunk/source/Core/ConnectionFileDescriptor.cpp

Modified: lldb/trunk/source/Core/ConnectionFileDescriptor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionFileDescriptor.cpp?rev=148616&r1=148615&r2=148616&view=diff
==============================================================================
--- lldb/trunk/source/Core/ConnectionFileDescriptor.cpp (original)
+++ lldb/trunk/source/Core/ConnectionFileDescriptor.cpp Fri Jan 20 20:03:41 2012
@@ -983,8 +983,16 @@
             //printf ("ConnectionFileDescriptor::SetSocketReceiveTimeout (timeout_usec = %u)\n", timeout_usec);
 
             struct timeval timeout;
-            timeout.tv_sec = timeout_usec / TimeValue::MicroSecPerSec;
-            timeout.tv_usec = timeout_usec % TimeValue::MicroSecPerSec;
+            if (timeout_usec == UINT32_MAX)
+            {
+                timeout.tv_sec = 0;
+                timeout.tv_usec = 0;
+            }
+            else
+            {
+                timeout.tv_sec = timeout_usec / TimeValue::MicroSecPerSec;
+                timeout.tv_usec = timeout_usec % TimeValue::MicroSecPerSec;
+            }
             if (::setsockopt (m_fd_recv, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)) == 0)
             {
                 m_socket_timeout_usec = timeout_usec;





More information about the lldb-commits mailing list