From 802caf025291e4a09d2488df5f1f53e99ad8b6ad Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 8 Feb 2018 21:21:07 +0300 Subject: [PATCH] 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). --- criu/cr-restore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/criu/cr-restore.c b/criu/cr-restore.c index 7188d1a9d..a7316f79c 100644 --- a/criu/cr-restore.c +++ b/criu/cr-restore.c @@ -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; }