]> granicus.if.org Git - strace/commit
USE_SEIZE: fix detaching from stopped processes
authorDenys Vlasenko <dvlasenk@redhat.com>
Wed, 19 Jun 2013 13:31:39 +0000 (15:31 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Thu, 20 Jun 2013 09:23:00 +0000 (11:23 +0200)
commit69e27ef24402059d1d103c83e511b62bc60310d2
tree7d321a27433e81b0e7ebadb8f8d419b0391dac96
parent0d7c3653c58036e0c27d2c321f482e11e6460262
USE_SEIZE: fix detaching from stopped processes

V3: split SEIZE/!SEIZE code paths to reduce confusion.
Extensively comment every possible case.
Verified that all tests/detach* tests work in both SEIZE and !SEIZE
cases.

* strace.c (detach): If PTRACE_SEIZE API is in use, stop the tracee
using PTRACE_INTERRUPT instead of sending it a SIGSTOP.
In a subsequent waitpid loop, correctly wait and suppress SIGSTOP
on detach if PTRACE_INTERRUPT wasn't used, or wait for any ptrace
stop and detach without suppressing signals.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
strace.c