diff options
author | Josh Gao <jmgao@google.com> | 2017-02-13 16:36:18 -0800 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2017-02-13 17:01:24 -0800 |
commit | c3c8c029ecc46aa5d9fe6a5ee7c77c8adc5b23b5 (patch) | |
tree | 98fb77b8170ab1478cd6c37a6af8c92bc14ad074 /debuggerd/handler/debuggerd_handler.cpp | |
parent | a3e4977325763b4a6fd290ee01b9ce133df8ab93 (diff) |
debuggerd_handler: don't use waitpid(..., __WCLONE).
waitpid(..., __WCLONE) fails with ECHILD when passed an explicit PID to
wait for. __WALL and __WCLONE don't seem to be necessary when waiting
for a specific pid, so just pass 0 in the flags instead.
Bug: http://b/35327712
Test: /data/nativetest/debuggerd_test/debuggerd_test32 --gtest_filter="*zombie*"
Change-Id: I3dd7a1bdf7ff35fdfbf631429c089ef4e3172855
Diffstat (limited to 'debuggerd/handler/debuggerd_handler.cpp')
-rw-r--r-- | debuggerd/handler/debuggerd_handler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/debuggerd/handler/debuggerd_handler.cpp b/debuggerd/handler/debuggerd_handler.cpp index 38a7be35f..353f642a8 100644 --- a/debuggerd/handler/debuggerd_handler.cpp +++ b/debuggerd/handler/debuggerd_handler.cpp @@ -249,7 +249,7 @@ static int debuggerd_dispatch_pseudothread(void* arg) { // Don't leave a zombie child. int status; - if (TEMP_FAILURE_RETRY(waitpid(forkpid, &status, __WCLONE)) == -1 && errno != ECHILD) { + if (TEMP_FAILURE_RETRY(waitpid(forkpid, &status, 0)) == -1) { __libc_format_log(ANDROID_LOG_FATAL, "libc", "failed to wait for crash_dump helper: %s", strerror(errno)); } else if (WIFSTOPPED(status) || WIFSIGNALED(status)) { |