[Lldb-commits] [PATCH] D58229: [lldb] [MainLoop] Report errno for failed kevent()

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 14 04:20:29 PST 2019


mgorny created this revision.
mgorny added reviewers: labath, krytarowski.
mgorny added a project: LLDB.
Herald added a subscriber: emaste.

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.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D58229

Files:
  lldb/source/Host/common/MainLoop.cpp


Index: lldb/source/Host/common/MainLoop.cpp
===================================================================
--- lldb/source/Host/common/MainLoop.cpp
+++ lldb/source/Host/common/MainLoop.cpp
@@ -108,7 +108,7 @@
                       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();
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58229.186816.patch
Type: text/x-patch
Size: 454 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190214/f2f144d7/attachment.bin>


More information about the lldb-commits mailing list