summaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2011-05-09 13:48:56 +0200
committerOleg Nesterov <oleg@redhat.com>2011-05-09 13:48:56 +0200
commit2e4f7c7769a0b8b6b3e88b0436c6c634f146a4ef (patch)
tree1e8a46790b0c0834006cd07c321aa4b7556a3d05 /kernel/signal.c
parentb013c399245a88a73aaa031279f0c4d7cea7fe68 (diff)
downloadop-kernel-dev-2e4f7c7769a0b8b6b3e88b0436c6c634f146a4ef.zip
op-kernel-dev-2e4f7c7769a0b8b6b3e88b0436c6c634f146a4ef.tar.gz
signal: sys_sigprocmask() needs retarget_shared_pending()
sys_sigprocmask() changes current->blocked by hand. Convert this code to use set_current_blocked(). Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index c0af959..b87780e 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2900,7 +2900,7 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset,
old_sigset_t __user *, oset)
{
old_sigset_t old_set, new_set;
- int error;
+ sigset_t new_blocked;
old_set = current->blocked.sig[0];
@@ -2909,27 +2909,23 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset,
return -EFAULT;
new_set &= ~(sigmask(SIGKILL) | sigmask(SIGSTOP));
- error = 0;
- spin_lock_irq(&current->sighand->siglock);
+ new_blocked = current->blocked;
+
switch (how) {
- default:
- error = -EINVAL;
- break;
case SIG_BLOCK:
- sigaddsetmask(&current->blocked, new_set);
+ sigaddsetmask(&new_blocked, new_set);
break;
case SIG_UNBLOCK:
- sigdelsetmask(&current->blocked, new_set);
+ sigdelsetmask(&new_blocked, new_set);
break;
case SIG_SETMASK:
- current->blocked.sig[0] = new_set;
+ new_blocked.sig[0] = new_set;
break;
+ default:
+ return -EINVAL;
}
- recalc_sigpending();
- spin_unlock_irq(&current->sighand->siglock);
- if (error)
- return error;
+ set_current_blocked(&new_blocked);
}
if (oset) {
OpenPOWER on IntegriCloud