aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha/kernel/signal.c')
-rw-r--r--arch/alpha/kernel/signal.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
index 6f7feb5db271..35f2ef44de12 100644
--- a/arch/alpha/kernel/signal.c
+++ b/arch/alpha/kernel/signal.c
@@ -120,12 +120,13 @@ SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
120 */ 120 */
121SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask) 121SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
122{ 122{
123 mask &= _BLOCKABLE; 123 sigset_t blocked;
124 spin_lock_irq(&current->sighand->siglock); 124
125 current->saved_sigmask = current->blocked; 125 current->saved_sigmask = current->blocked;
126 siginitset(&current->blocked, mask); 126
127 recalc_sigpending(); 127 mask &= _BLOCKABLE;
128 spin_unlock_irq(&current->sighand->siglock); 128 siginitset(&blocked, mask);
129 set_current_blocked(&blocked);
129 130
130 current->state = TASK_INTERRUPTIBLE; 131 current->state = TASK_INTERRUPTIBLE;
131 schedule(); 132 schedule();
@@ -238,10 +239,7 @@ do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs,
238 goto give_sigsegv; 239 goto give_sigsegv;
239 240
240 sigdelsetmask(&set, ~_BLOCKABLE); 241 sigdelsetmask(&set, ~_BLOCKABLE);
241 spin_lock_irq(&current->sighand->siglock); 242 set_current_blocked(&set);
242 current->blocked = set;
243 recalc_sigpending();
244 spin_unlock_irq(&current->sighand->siglock);
245 243
246 if (restore_sigcontext(sc, regs, sw)) 244 if (restore_sigcontext(sc, regs, sw))
247 goto give_sigsegv; 245 goto give_sigsegv;
@@ -276,10 +274,7 @@ do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs,
276 goto give_sigsegv; 274 goto give_sigsegv;
277 275
278 sigdelsetmask(&set, ~_BLOCKABLE); 276 sigdelsetmask(&set, ~_BLOCKABLE);
279 spin_lock_irq(&current->sighand->siglock); 277 set_current_blocked(&set);
280 current->blocked = set;
281 recalc_sigpending();
282 spin_unlock_irq(&current->sighand->siglock);
283 278
284 if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw)) 279 if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw))
285 goto give_sigsegv; 280 goto give_sigsegv;
@@ -501,14 +496,8 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
501 else 496 else
502 ret = setup_frame(sig, ka, oldset, regs, sw); 497 ret = setup_frame(sig, ka, oldset, regs, sw);
503 498
504 if (ret == 0) { 499 if (ret == 0)
505 spin_lock_irq(&current->sighand->siglock); 500 block_sigmask(ka, sig);
506 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
507 if (!(ka->sa.sa_flags & SA_NODEFER))
508 sigaddset(&current->blocked,sig);
509 recalc_sigpending();
510 spin_unlock_irq(&current->sighand->siglock);
511 }
512 501
513 return ret; 502 return ret;
514} 503}