[Lldb-commits] [lldb] r234341 - Fix bug where an additional O packet is sent after inferior exits.

Chaoren Lin chaorenl at google.com
Tue Apr 7 11:45:03 PDT 2015


Author: chaoren
Date: Tue Apr  7 13:45:03 2015
New Revision: 234341

URL: http://llvm.org/viewvc/llvm-project?rev=234341&view=rev
Log:
Fix bug where an additional O packet is sent after inferior exits.

Summary:
ConnectionFileDescriptor::Read was returning eConnectionStatusError instead of 0
on m_shutting_down, which caused the caller to think that some number of bytes
were read.

Reviewers: jingham, vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8850

Modified:
    lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp

Modified: lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp?rev=234341&r1=234340&r2=234341&view=diff
==============================================================================
--- lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp (original)
+++ lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp Tue Apr  7 13:45:03 2015
@@ -386,8 +386,12 @@ ConnectionFileDescriptor::Read(void *dst
         status = eConnectionStatusTimedOut;
         return 0;
     }
-    else if (m_shutting_down)
-        return eConnectionStatusError;
+
+    if (m_shutting_down)
+    {
+        status = eConnectionStatusError;
+        return 0;
+    }
 
     status = BytesAvailable(timeout_usec, error_ptr);
     if (status != eConnectionStatusSuccess)





More information about the lldb-commits mailing list