mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-02 09:33:59 +00:00
lldb can interrupt waitpid, so EINTR shouldn't be an error. This fixes the case
where there is no timeout. In the case where there is a timeout though, the code is still wrong since it doesn't check that the alarm really went off. Without this patch, I cannot debug a program that forks itself using sys::ExecuteAndWait with lldb. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211918 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
896cde882f
commit
86ebb340ef
@ -350,7 +350,11 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
|
||||
// Parent process: Wait for the child process to terminate.
|
||||
int status;
|
||||
ProcessInfo WaitResult;
|
||||
WaitResult.Pid = waitpid(ChildPid, &status, WaitPidOptions);
|
||||
|
||||
do {
|
||||
WaitResult.Pid = waitpid(ChildPid, &status, WaitPidOptions);
|
||||
} while (WaitUntilTerminates && WaitResult.Pid == -1 && errno == EINTR);
|
||||
|
||||
if (WaitResult.Pid != PI.Pid) {
|
||||
if (WaitResult.Pid == 0) {
|
||||
// Non-blocking wait.
|
||||
|
Loading…
x
Reference in New Issue
Block a user