[CRIU] [PATCH] restore: fix checking error code of sys_sigaction

Andrey Vagin avagin at openvz.org
Wed Oct 7 23:29:30 PDT 2015


From: Andrew Vagin <avagin at openvz.org>

sys_sigaction() returns an error code

Reported-by: Kir Kolyshkin <kir at openvz.org>
Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 cr-restore.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 9781fc2..fb86114 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -720,8 +720,9 @@ static int prepare_sigactions(void)
 		 * sigaction overwrites se_restorer.
 		 */
 		ret = sys_sigaction(sig, &act, NULL, sizeof(k_rtsigset_t));
-		if (ret == -1) {
-			pr_err("%d: Can't restore sigaction: %m\n", pid);
+		if (ret < 0) {
+			errno = -ret;
+			pr_perror("Can't restore sigaction");
 			goto err;
 		}
 
-- 
2.4.3



More information about the CRIU mailing list