diff --git a/attach.c b/attach.c index 9dd1552..fde9396 100644 --- a/attach.c +++ b/attach.c @@ -117,8 +117,8 @@ int do_setsid(struct ptrace_child *child) { out_kill: kill(dummy.pid, SIGKILL); - ptrace_wait(&dummy); ptrace_detach_child(&dummy); + ptrace_wait(&dummy); do_syscall(child, wait4, dummy.pid, 0, WNOHANG, 0, 0, 0); return err; }