提交 93ad209f 编写于 作者: A aarzilli

proc: bugfix: Detach(true) does not kill tracee

Instead of using PTRACE_DETACH to inject SIGINT into the tracee use
sys.Kill directly: PTRACE_DETACH is allowed to ignore its signal
argument if the tracee isn't in signal-delivery-stop status.
上级 466960d9
......@@ -101,11 +101,13 @@ func (dbp *Process) Detach(kill bool) (err error) {
}
}
dbp.execPtraceFunc(func() {
var sig int
err = PtraceDetach(dbp.Pid, 0)
if err != nil {
return
}
if kill {
sig = int(sys.SIGINT)
err = sys.Kill(dbp.Pid, sys.SIGINT)
}
err = PtraceDetach(dbp.Pid, sig)
})
return
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册