[NativeProcessLinux] Bugfix in the monitor thread
authorPavel Labath <labath@google.com>
Mon, 20 Jul 2015 16:14:46 +0000 (16:14 +0000)
committerPavel Labath <labath@google.com>
Mon, 20 Jul 2015 16:14:46 +0000 (16:14 +0000)
Make sure we dont treat EINTR as a fatal error. I was getting this when trying to profile the
debugger. I'm not sure why this wasn't surfacing before, it could be that the profiler is using
some signals internally.

llvm-svn: 242681

lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp

index 372ac78..8563872 100644 (file)
@@ -744,6 +744,9 @@ NativeProcessLinux::Monitor::MainLoop()
         int r = select(max_fd, &fds, nullptr, nullptr, nullptr);
         if (r < 0)
         {
+            if (errno == EINTR)
+                continue;
+
             Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
             if (log)
                 log->Printf("NativeProcessLinux::Monitor::%s exiting because select failed: %s",