[PATCH] Typo in ProcessMonitor::WaitForInitialTIDStop? for linux


I'm trying to discover why a tracer stop gets reported as process exit
by 32-bit linux lldb. I happened upon this piece of code:

ProcessMonitor::WaitForInitialTIDStop(lldb::tid_t tid)
     Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS));
     if (log)
         log->Printf ("ProcessMonitor::%s(%" PRIu64 ") waiting for thread to stop...", __FUNCTION__, tid);

     // Wait for the thread to stop
     while (true)
         int status = -1;
         if (log)
             log->Printf ("ProcessMonitor::%s(%" PRIu64 ") waitpid...", __FUNCTION__, tid);
         lldb::pid_t wait_pid = waitpid(tid, &status, __WALL);
         if (status == -1)
             // If we got interrupted by a signal (in our process, not the
             // inferior) try again.
             if (errno == EINTR)

Surely this line is wrong "if (status == -1)" ?? We should checking the
return value of waitpid not the optional status field.

Patch attached.

Index: source/Plugins/Process/Linux/ProcessMonitor.cpp

ProcessMonitor.cpp.diff (634 Bytes)