[CRIU] [PATCH 07/18] compel: handle errors of sigaction()

Andrei Vagin avagin at openvz.org
Thu Nov 9 22:21:01 MSK 2017


From: Andrei Vagin <avagin at virtuozzo.com>

CID 174735 (#1 of 1): Unchecked return value (CHECKED_RETURN)
2. check_return: Calling sigaction without checking return value (as is done elsewhere 31 out of 35 times).

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 compel/src/lib/infect.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/compel/src/lib/infect.c b/compel/src/lib/infect.c
index 9ebc5b5ac..9babdca75 100644
--- a/compel/src/lib/infect.c
+++ b/compel/src/lib/infect.c
@@ -1175,7 +1175,11 @@ struct parasite_ctl *compel_prepare(int pid)
 	ictx->open_proc = simple_open_proc;
 	ictx->syscall_ip = find_executable_area(pid);
 	ictx->child_handler = handle_sigchld;
-	sigaction(SIGCHLD, NULL, &ictx->orig_handler);
+
+	if (sigaction(SIGCHLD, NULL, &ictx->orig_handler)) {
+		pr_perror("Unable to get a signal action");
+		goto err;
+	}
 
 	ictx->save_regs = save_regs_plain;
 	ictx->make_sigframe = make_sigframe_plain;
-- 
2.13.6



More information about the CRIU mailing list