Skip to content

Commit 8368b0e

Browse files
Matt Flemingpmundt
authored andcommitted
sh: no need to reset handler if SA_ONESHOT
get_signal_to_deliver() already resets the signal handler if SA_ONESHOT is set in ka->sa.sa_flags, there's no need to do it again in handle_signal(). Furthermore, because we were modifying ka->sa.sa_handler (which is a copy of sighand->action[]) instead of sighand->action[] the original code had no effect on signal delivery. Acked-by: Oleg Nesterov <oleg@redhat.com> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent b448d6a commit 8368b0e

2 files changed

Lines changed: 0 additions & 6 deletions

File tree

‎arch/sh/kernel/signal_32.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,6 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
548548
else
549549
ret = setup_frame(sig, ka, oldset, regs);
550550

551-
if (ka->sa.sa_flags & SA_ONESHOT)
552-
ka->sa.sa_handler = SIG_DFL;
553-
554551
if (ret == 0) {
555552
spin_lock_irq(&current->sighand->siglock);
556553
sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);

‎arch/sh/kernel/signal_64.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,6 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
734734
else
735735
ret = setup_frame(sig, ka, oldset, regs);
736736

737-
if (ka->sa.sa_flags & SA_ONESHOT)
738-
ka->sa.sa_handler = SIG_DFL;
739-
740737
if (ret == 0) {
741738
spin_lock_irq(&current->sighand->siglock);
742739
sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);

0 commit comments

Comments
 (0)