mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 01:51:51 +00:00
ptrace: Send signals with final state explicitly
According to Oleg the PTRACE_KILL doesn't and was-not-supposed-to work. Thus, kill tasks to final state explicitly and just detach from them. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
parent
cff9654d62
commit
06cc19511a
15
ptrace.c
15
ptrace.c
@ -21,15 +21,14 @@
|
||||
|
||||
int unseize_task(pid_t pid, enum cr_task_state st)
|
||||
{
|
||||
if (st == CR_TASK_STOP)
|
||||
return ptrace(PTRACE_DETACH, pid, NULL, NULL);
|
||||
else if (st == CR_TASK_KILL) {
|
||||
if (st == CR_TASK_KILL)
|
||||
kill(pid, SIGKILL);
|
||||
return ptrace(PTRACE_KILL, pid, NULL, NULL);
|
||||
} else {
|
||||
BUG_ON(1);
|
||||
return -1;
|
||||
}
|
||||
else if (st == CR_TASK_STOP)
|
||||
kill(pid, SIGSTOP);
|
||||
else
|
||||
pr_err("Unknown final state %d\n", st);
|
||||
|
||||
return ptrace(PTRACE_DETACH, pid, NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user