diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-03-21 19:33:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 20:54:55 -0400 |
commit | ce24d8a14207c2036df86d2bd3d14b4393eb51e3 (patch) | |
tree | 41644b88fc0b226c7fcf1c935ac262a07e94aac1 /arch/sparc | |
parent | d12f7c4a2f5d5c03ace0543d8cc70966c54d0692 (diff) |
sparc: use block_sigmask()
Use the new helper function introduced in commit 5e6292c0f28f ("signal:
add block_sigmask() for adding sigmask to current->blocked") which
centralises the code for updating current->blocked after successfully
delivering a signal and reduces the amount of duplicate code across
architectures. In the past some architectures got this code wrong, so
using this helper function should stop that from happening again.
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/signal32.c | 7 | ||||
-rw-r--r-- | arch/sparc/kernel/signal_32.c | 7 | ||||
-rw-r--r-- | arch/sparc/kernel/signal_64.c | 6 |
3 files changed, 3 insertions, 17 deletions
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index 023b8860dc97..c8f5b50db89c 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c | |||
@@ -776,7 +776,6 @@ static inline int handle_signal32(unsigned long signr, struct k_sigaction *ka, | |||
776 | siginfo_t *info, | 776 | siginfo_t *info, |
777 | sigset_t *oldset, struct pt_regs *regs) | 777 | sigset_t *oldset, struct pt_regs *regs) |
778 | { | 778 | { |
779 | sigset_t blocked; | ||
780 | int err; | 779 | int err; |
781 | 780 | ||
782 | if (ka->sa.sa_flags & SA_SIGINFO) | 781 | if (ka->sa.sa_flags & SA_SIGINFO) |
@@ -787,11 +786,7 @@ static inline int handle_signal32(unsigned long signr, struct k_sigaction *ka, | |||
787 | if (err) | 786 | if (err) |
788 | return err; | 787 | return err; |
789 | 788 | ||
790 | sigorsets(&blocked, ¤t->blocked, &ka->sa.sa_mask); | 789 | block_sigmask(ka, signr); |
791 | if (!(ka->sa.sa_flags & SA_NOMASK)) | ||
792 | sigaddset(&blocked, signr); | ||
793 | set_current_blocked(&blocked); | ||
794 | |||
795 | tracehook_signal_handler(signr, info, ka, regs, 0); | 790 | tracehook_signal_handler(signr, info, ka, regs, 0); |
796 | 791 | ||
797 | return 0; | 792 | return 0; |
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index d54c6e53aba0..7bb71b6fbd20 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -465,7 +465,6 @@ static inline int | |||
465 | handle_signal(unsigned long signr, struct k_sigaction *ka, | 465 | handle_signal(unsigned long signr, struct k_sigaction *ka, |
466 | siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) | 466 | siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) |
467 | { | 467 | { |
468 | sigset_t blocked; | ||
469 | int err; | 468 | int err; |
470 | 469 | ||
471 | if (ka->sa.sa_flags & SA_SIGINFO) | 470 | if (ka->sa.sa_flags & SA_SIGINFO) |
@@ -476,11 +475,7 @@ handle_signal(unsigned long signr, struct k_sigaction *ka, | |||
476 | if (err) | 475 | if (err) |
477 | return err; | 476 | return err; |
478 | 477 | ||
479 | sigorsets(&blocked, ¤t->blocked, &ka->sa.sa_mask); | 478 | block_sigmask(ka, signr); |
480 | if (!(ka->sa.sa_flags & SA_NOMASK)) | ||
481 | sigaddset(&blocked, signr); | ||
482 | set_current_blocked(&blocked); | ||
483 | |||
484 | tracehook_signal_handler(signr, info, ka, regs, 0); | 479 | tracehook_signal_handler(signr, info, ka, regs, 0); |
485 | 480 | ||
486 | return 0; | 481 | return 0; |
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index f0836cd0e2f2..d8a67e60be80 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
@@ -479,18 +479,14 @@ static inline int handle_signal(unsigned long signr, struct k_sigaction *ka, | |||
479 | siginfo_t *info, | 479 | siginfo_t *info, |
480 | sigset_t *oldset, struct pt_regs *regs) | 480 | sigset_t *oldset, struct pt_regs *regs) |
481 | { | 481 | { |
482 | sigset_t blocked; | ||
483 | int err; | 482 | int err; |
484 | 483 | ||
485 | err = setup_rt_frame(ka, regs, signr, oldset, | 484 | err = setup_rt_frame(ka, regs, signr, oldset, |
486 | (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL); | 485 | (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL); |
487 | if (err) | 486 | if (err) |
488 | return err; | 487 | return err; |
489 | sigorsets(&blocked, ¤t->blocked, &ka->sa.sa_mask); | ||
490 | if (!(ka->sa.sa_flags & SA_NOMASK)) | ||
491 | sigaddset(&blocked, signr); | ||
492 | set_current_blocked(&blocked); | ||
493 | 488 | ||
489 | block_sigmask(ka, signr); | ||
494 | tracehook_signal_handler(signr, info, ka, regs, 0); | 490 | tracehook_signal_handler(signr, info, ka, regs, 0); |
495 | 491 | ||
496 | return 0; | 492 | return 0; |