diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2015-12-24 19:14:15 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2015-12-24 19:14:15 +0100 |
| commit | d9b493f203ab5649809c4b1a5096272ba6e40bda (patch) | |
| tree | ffad24b18f5f9b127ef0e6f33efb3c7ddb70b82d /executor/executor.cc | |
| parent | af4e0c0b7a9556fd09c544bb2d8431764118b373 (diff) | |
executor: don't use WUNTRACED in wait
WUNTRACED wait returns when child has stopped.
That's not what we want to wait for.
If it's stopped we need to timeout wait and kill
the stopped child.
Diffstat (limited to 'executor/executor.cc')
| -rw-r--r-- | executor/executor.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/executor/executor.cc b/executor/executor.cc index 4b1b38968..6b15aa401 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -221,7 +221,7 @@ int main() kill(pid, SIGKILL); } debug("waitpid(%d)\n", pid); - if (waitpid(pid, &status, __WALL | WUNTRACED) != pid) + if (waitpid(pid, &status, __WALL) != pid) fail("waitpid failed"); debug("waitpid(%d) returned\n", pid); // Drain SIGCHLD signals. @@ -235,7 +235,7 @@ int main() // We've hit 2 systems that mishandle sigtimedwait. uint64_t start = current_time_ms(); for (;;) { - int res = waitpid(pid, &status, __WALL | WUNTRACED | WNOHANG); + int res = waitpid(pid, &status, __WALL | WNOHANG); debug("waitpid(%d)=%d (%d)\n", pid, res, errno); if (res == pid) break; @@ -244,7 +244,7 @@ int main() debug("killing\n"); kill(-pid, SIGKILL); kill(pid, SIGKILL); - int res = waitpid(pid, &status, __WALL | WUNTRACED); + int res = waitpid(pid, &status, __WALL); debug("waitpid(%d)=%d (%d)\n", pid, res, errno); if (res == pid) break; |
