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();
 }
 


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();
 }
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to