diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2013-06-21 15:50:41 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2013-06-21 15:50:41 +0200 |
commit | a2de9dacec47b7902b19f37edcc564faff346816 (patch) | |
tree | 172c22c15ced339fa421c6822ae384160362cbbb /strace.c | |
parent | fdfa47af7e05b320cc1c62fc5854ded781679917 (diff) | |
download | android_external_strace-a2de9dacec47b7902b19f37edcc564faff346816.tar.gz android_external_strace-a2de9dacec47b7902b19f37edcc564faff346816.tar.bz2 android_external_strace-a2de9dacec47b7902b19f37edcc564faff346816.zip |
Eat pending SIGSTOP _before_ PTRACE_DETACH in detach()
* strace.c (detach): If TCB_IGNORE_ONE_SIGSTOP is set,
di not PTRACE_DETACH - wait for SIGSTOP first.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'strace.c')
-rw-r--r-- | strace.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -758,6 +758,8 @@ detach(struct tcb *tcp) * would be left stopped (process state T). */ sigstop_expected = (tcp->flags & TCB_IGNORE_ONE_SIGSTOP); + if (sigstop_expected) + goto wait_loop; error = ptrace(PTRACE_DETACH, tcp->pid, 0, 0); if (error == 0) { /* On a clear day, you can see forever. */ @@ -802,6 +804,7 @@ detach(struct tcb *tcp) } if (sigstop_expected || interrupt_done) { + wait_loop: for (;;) { int sig; if (waitpid(tcp->pid, &status, __WALL) < 0) { |