2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 09:58:09 +00:00

ptrace: Print proper errors when seize failed

I'd appreciate if we get rid of these misleading macros at all eventually...

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Pavel Emelyanov 2012-01-19 19:21:16 +04:00 committed by Cyrill Gorcunov
parent 42cbb5bafc
commit 7e8eb76e9d

View File

@ -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)