[Lldb-commits] [PATCH] Enhance the Pipe interface for better portability

Zachary Turner zturner at google.com
Tue Dec 16 16:40:51 PST 2014


================
Comment at: source/Host/posix/ConnectionFileDescriptorPosix.cpp:297
@@ -295,1 +296,3 @@
+    Error result = m_pipe.Write("i", 1, bytes_written);
+    return result.Success();
 }
----------------
ovyalov wrote:
> return (result.Success() && bytes_written == 1) ?
It seems redundant to check for bytes_written == 1.  A postcondition of Pipe::Write should be that result.Success() implies bytes_written == bytes_requested.

================
Comment at: source/Host/posix/ConnectionFileDescriptorPosix.cpp:337
@@ -333,3 +336,3 @@
                 log->Printf("%p ConnectionFileDescriptor::Disconnect(): Couldn't get the lock, sent 'q' to %d, result = %d.",
-                            static_cast<void *>(this), m_pipe.GetWriteFileDescriptor(), result);
+                            static_cast<void *>(this), m_pipe.GetWriteFileDescriptor(), bytes_written);
         }
----------------
ovyalov wrote:
> Do we need to log result variable instead of bytes_written?
Seems reasonable.  After fixing these issues i'll go ahead and commit.

http://reviews.llvm.org/D6686

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list