2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

restore: print a error if ptrace() failed

CID 85039 (#1 of 1): Unchecked return value (CHECKED_RETURN)
6. check_return: Calling ptrace without checking return value (as is done elsewhere 44 out of 49 times).
This commit is contained in:
Andrei Vagin 2018-02-08 21:21:07 +03:00
parent 04c1634dfc
commit 802caf0252

View File

@ -1564,7 +1564,8 @@ static void sigchld_handler(int signal, siginfo_t *siginfo, void *data)
if (!current && WIFSTOPPED(status) &&
WSTOPSIG(status) == SIGCHLD) {
/* The root task is ptraced. Allow it to handle SIGCHLD */
ptrace(PTRACE_CONT, siginfo->si_pid, 0, SIGCHLD);
if (ptrace(PTRACE_CONT, pid, 0, SIGCHLD))
pr_perror("Unable to resume %d", pid);
return;
}