[Lldb-commits] [PATCH] D33831: Add temp_failure_retry helper function

Kamil Rytarowski via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 2 07:48:20 PDT 2017


krytarowski added inline comments.


================
Comment at: source/Plugins/Process/FreeBSD/ProcessMonitor.cpp:788
 
-WAIT_AGAIN:
-  // Wait for the operation thread to initialize.
-  if (sem_wait(&args->m_semaphore)) {
-    if (errno == EINTR)
-      goto WAIT_AGAIN;
-    else {
-      error.SetErrorToErrno();
-      return;
-    }
+  if (temp_failure_retry(-1 sem_wait, &args->m_semaphore) == -1) {
+    error.SetErrorToErrno();
----------------
`-1 sem_wait` -> `-1, ::sem_wait`


================
Comment at: source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:852
+  ::pid_t wait_pid =
+      temp_failure_retry(-1, waitpid, GetID(), &status, WALLSIG | WNOHANG);
 
----------------
It might be prettier to use consistently `::waitpid` across the whole codebase, here and in other places.


https://reviews.llvm.org/D33831





More information about the lldb-commits mailing list