[CRIU] [PATCH] criu: restore blocked signals correctly

Andrey Vagin avagin at openvz.org
Fri Oct 9 12:47:14 PDT 2015


From: Andrew Vagin <avagin at openvz.org>

We need to use SIG_SETMASK instead of SIG_BLOCK.

SIG_SETMASK
      The set of blocked signals is set to the argument set.

Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 namespaces.c | 2 +-
 sysctl.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/namespaces.c b/namespaces.c
index 7d0690c..4233c59 100644
--- a/namespaces.c
+++ b/namespaces.c
@@ -1201,7 +1201,7 @@ int stop_usernsd(void)
 			ret = -1;
 
 		usernsd_pid = 0;
-		sigprocmask(SIG_BLOCK, &oldmask, NULL);
+		sigprocmask(SIG_SETMASK, &oldmask, NULL);
 
 		if (ret != 0)
 			pr_err("UNS: daemon exited abnormally\n");
diff --git a/sysctl.c b/sysctl.c
index 7dd08ba..489c599 100644
--- a/sysctl.c
+++ b/sysctl.c
@@ -314,7 +314,7 @@ static int __userns_sysctl_op(void *arg, int proc_fd, pid_t pid)
 		kill(worker, SIGKILL);
 		goto out;
 	}
-	sigprocmask(SIG_BLOCK, &oldmask, NULL);
+	sigprocmask(SIG_SETMASK, &oldmask, NULL);
 
 	if (!WIFEXITED(status) || WEXITSTATUS(status)) {
 		pr_err("worker failed: %d\n", status);
-- 
2.4.3



More information about the CRIU mailing list