[CRIU] [PATCH 04/18] restore: resume a pid what was returned by waitpid

Andrei Vagin avagin at openvz.org
Thu Nov 9 22:20:58 MSK 2017


From: Andrei Vagin <avagin at virtuozzo.com>

and print a error message in a error case.

CID 85039 (#1 of 1): Unchecked return value (CHECKED_RETURN)
6. check_return: Calling ptrace without checking return value (as is done elsewhere 49 out of 59 times).

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 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 79e9a670f..f80378868 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1526,7 +1526,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 the %d task", pid);
 			return;
 		}
 
-- 
2.13.6



More information about the CRIU mailing list