[Lldb-commits] [lldb] r354029 - [lldb] [MainLoop] Report errno for failed kevent()

Michal Gorny via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 14 05:52:31 PST 2019


Author: mgorny
Date: Thu Feb 14 05:52:31 2019
New Revision: 354029

URL: http://llvm.org/viewvc/llvm-project?rev=354029&view=rev
Log:
[lldb] [MainLoop] Report errno for failed kevent()

Modify the kevent() error reporting to use errno rather than returning
the return value.  At least on FreeBSD and NetBSD, kevent() always
returns -1 in case of error, and the actual error is returned via errno.

Differential Revision: https://reviews.llvm.org/D58229

Modified:
    lldb/trunk/source/Host/common/MainLoop.cpp

Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=354029&r1=354028&r2=354029&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Thu Feb 14 05:52:31 2019
@@ -108,7 +108,7 @@ Status MainLoop::RunImpl::Poll() {
                       out_events, llvm::array_lengthof(out_events), nullptr);
 
   if (num_events < 0)
-    return Status("kevent() failed with error %d\n", num_events);
+    return Status(errno, eErrorTypePOSIX);
   return Status();
 }
 




More information about the lldb-commits mailing list