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:
parent
42cbb5bafc
commit
7e8eb76e9d
15
ptrace.c
15
ptrace.c
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user