Commit 7e8eb76e authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

ptrace: Print proper errors when seize failed

I'd appreciate if we get rid of these misleading macros at all eventually...
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 42cbb5ba
...@@ -36,9 +36,18 @@ int seize_task(pid_t pid) ...@@ -36,9 +36,18 @@ int seize_task(pid_t pid)
int status; int status;
int ret = 0; int ret = 0;
jerr_rc(ptrace(PTRACE_SEIZE, pid, NULL, ret = ptrace(PTRACE_SEIZE, pid, NULL,
(void *)(unsigned long)PTRACE_SEIZE_DEVEL), ret, err); (void *)(unsigned long)PTRACE_SEIZE_DEVEL);
jerr_rc(ptrace(PTRACE_INTERRUPT, pid, NULL, NULL), ret, err); if (ret < 0) {
pr_perror("Can't seize task\n");
goto err;
}
ret = ptrace(PTRACE_INTERRUPT, pid, NULL, NULL);
if (ret < 0) {
pr_perror("Can't interrupt task\n");
goto err;
}
ret = -10; ret = -10;
if (wait4(pid, &status, __WALL, NULL) != pid) if (wait4(pid, &status, __WALL, NULL) != pid)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment