<p dir="ltr"><br>
On Oct 12, 2015 10:50, "Pavel Emelyanov" <<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>> wrote:<br>
><br>
> On 10/09/2015 10:47 PM, Andrey Vagin wrote:<br>
> > From: Andrew Vagin <<a href="mailto:avagin@openvz.org">avagin@openvz.org</a>><br>
> ><br>
> > We need to use SIG_SETMASK instead of SIG_BLOCK.<br>
><br>
> Why?<br>
><br>
> > SIG_SETMASK<br>
> > The set of blocked signals is set to the argument set.</p>
<p dir="ltr">Because sig_setmask sets a specified mask, sig_blockmask adds signals from a specified mask to the current mask</p>
<p dir="ltr">> ><br>
> > Signed-off-by: Andrew Vagin <<a href="mailto:avagin@openvz.org">avagin@openvz.org</a>><br>
> > ---<br>
> > namespaces.c | 2 +-<br>
> > sysctl.c | 2 +-<br>
> > 2 files changed, 2 insertions(+), 2 deletions(-)<br>
> ><br>
> > diff --git a/namespaces.c b/namespaces.c<br>
> > index 7d0690c..4233c59 100644<br>
> > --- a/namespaces.c<br>
> > +++ b/namespaces.c<br>
> > @@ -1201,7 +1201,7 @@ int stop_usernsd(void)<br>
> > ret = -1;<br>
> ><br>
> > usernsd_pid = 0;<br>
> > - sigprocmask(SIG_BLOCK, &oldmask, NULL);<br>
> > + sigprocmask(SIG_SETMASK, &oldmask, NULL);<br>
> ><br>
> > if (ret != 0)<br>
> > pr_err("UNS: daemon exited abnormally\n");<br>
> > diff --git a/sysctl.c b/sysctl.c<br>
> > index 7dd08ba..489c599 100644<br>
> > --- a/sysctl.c<br>
> > +++ b/sysctl.c<br>
> > @@ -314,7 +314,7 @@ static int __userns_sysctl_op(void *arg, int proc_fd, pid_t pid)<br>
> > kill(worker, SIGKILL);<br>
> > goto out;<br>
> > }<br>
> > - sigprocmask(SIG_BLOCK, &oldmask, NULL);<br>
> > + sigprocmask(SIG_SETMASK, &oldmask, NULL);<br>
> ><br>
> > if (!WIFEXITED(status) || WEXITSTATUS(status)) {<br>
> > pr_err("worker failed: %d\n", status);<br>
> ><br>
><br>
</p>