diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-21 23:42:15 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:58:49 -0400 |
commit | a610d6e672d6d3723e8da257ad4a8a288a8f2f89 (patch) | |
tree | 2fac6ce7f72756771f4f87583205cc402589dcad /arch/sparc/kernel | |
parent | 5754f412a3f107cbcd93ee125bef296f2a07539b (diff) |
pull clearing RESTORE_SIGMASK into block_sigmask()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/signal32.c | 15 | ||||
-rw-r--r-- | arch/sparc/kernel/signal_32.c | 16 | ||||
-rw-r--r-- | arch/sparc/kernel/signal_64.c | 15 |
3 files changed, 9 insertions, 37 deletions
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index 88e0d8122d2c..8c93c00922a7 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c | |||
@@ -775,7 +775,7 @@ sigsegv: | |||
775 | return -EFAULT; | 775 | return -EFAULT; |
776 | } | 776 | } |
777 | 777 | ||
778 | static inline int handle_signal32(unsigned long signr, struct k_sigaction *ka, | 778 | static inline void handle_signal32(unsigned long signr, struct k_sigaction *ka, |
779 | siginfo_t *info, | 779 | siginfo_t *info, |
780 | sigset_t *oldset, struct pt_regs *regs) | 780 | sigset_t *oldset, struct pt_regs *regs) |
781 | { | 781 | { |
@@ -787,12 +787,10 @@ static inline int handle_signal32(unsigned long signr, struct k_sigaction *ka, | |||
787 | err = setup_frame32(ka, regs, signr, oldset); | 787 | err = setup_frame32(ka, regs, signr, oldset); |
788 | 788 | ||
789 | if (err) | 789 | if (err) |
790 | return err; | 790 | return; |
791 | 791 | ||
792 | block_sigmask(ka, signr); | 792 | block_sigmask(ka, signr); |
793 | tracehook_signal_handler(signr, info, ka, regs, 0); | 793 | tracehook_signal_handler(signr, info, ka, regs, 0); |
794 | |||
795 | return 0; | ||
796 | } | 794 | } |
797 | 795 | ||
798 | static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs, | 796 | static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs, |
@@ -841,14 +839,7 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs) | |||
841 | if (signr > 0) { | 839 | if (signr > 0) { |
842 | if (restart_syscall) | 840 | if (restart_syscall) |
843 | syscall_restart32(orig_i0, regs, &ka.sa); | 841 | syscall_restart32(orig_i0, regs, &ka.sa); |
844 | if (handle_signal32(signr, &ka, &info, oldset, regs) == 0) { | 842 | handle_signal32(signr, &ka, &info, oldset, regs); |
845 | /* A signal was successfully delivered; the saved | ||
846 | * sigmask will have been stored in the signal frame, | ||
847 | * and will be restored by sigreturn, so we can simply | ||
848 | * clear the TS_RESTORE_SIGMASK flag. | ||
849 | */ | ||
850 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | ||
851 | } | ||
852 | return; | 843 | return; |
853 | } | 844 | } |
854 | if (restart_syscall && | 845 | if (restart_syscall && |
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 5d74410c787b..ee81b90c532f 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -449,7 +449,7 @@ sigsegv: | |||
449 | return -EFAULT; | 449 | return -EFAULT; |
450 | } | 450 | } |
451 | 451 | ||
452 | static inline int | 452 | static inline void |
453 | handle_signal(unsigned long signr, struct k_sigaction *ka, | 453 | handle_signal(unsigned long signr, struct k_sigaction *ka, |
454 | siginfo_t *info, struct pt_regs *regs) | 454 | siginfo_t *info, struct pt_regs *regs) |
455 | { | 455 | { |
@@ -462,12 +462,10 @@ handle_signal(unsigned long signr, struct k_sigaction *ka, | |||
462 | err = setup_frame(ka, regs, signr, oldset); | 462 | err = setup_frame(ka, regs, signr, oldset); |
463 | 463 | ||
464 | if (err) | 464 | if (err) |
465 | return err; | 465 | return; |
466 | 466 | ||
467 | block_sigmask(ka, signr); | 467 | block_sigmask(ka, signr); |
468 | tracehook_signal_handler(signr, info, ka, regs, 0); | 468 | tracehook_signal_handler(signr, info, ka, regs, 0); |
469 | |||
470 | return 0; | ||
471 | } | 469 | } |
472 | 470 | ||
473 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, | 471 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, |
@@ -539,15 +537,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
539 | if (signr > 0) { | 537 | if (signr > 0) { |
540 | if (restart_syscall) | 538 | if (restart_syscall) |
541 | syscall_restart(orig_i0, regs, &ka.sa); | 539 | syscall_restart(orig_i0, regs, &ka.sa); |
542 | if (handle_signal(signr, &ka, &info, regs) == 0) { | 540 | handle_signal(signr, &ka, &info, regs); |
543 | /* a signal was successfully delivered; the saved | ||
544 | * sigmask will have been stored in the signal frame, | ||
545 | * and will be restored by sigreturn, so we can simply | ||
546 | * clear the TIF_RESTORE_SIGMASK flag. | ||
547 | */ | ||
548 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
549 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
550 | } | ||
551 | return; | 541 | return; |
552 | } | 542 | } |
553 | if (restart_syscall && | 543 | if (restart_syscall && |
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index 088a733f83f9..febbc4b697ba 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
@@ -466,7 +466,7 @@ sigsegv: | |||
466 | return -EFAULT; | 466 | return -EFAULT; |
467 | } | 467 | } |
468 | 468 | ||
469 | static inline int handle_signal(unsigned long signr, struct k_sigaction *ka, | 469 | static inline void handle_signal(unsigned long signr, struct k_sigaction *ka, |
470 | siginfo_t *info, | 470 | siginfo_t *info, |
471 | sigset_t *oldset, struct pt_regs *regs) | 471 | sigset_t *oldset, struct pt_regs *regs) |
472 | { | 472 | { |
@@ -475,12 +475,10 @@ static inline int handle_signal(unsigned long signr, struct k_sigaction *ka, | |||
475 | err = setup_rt_frame(ka, regs, signr, oldset, | 475 | err = setup_rt_frame(ka, regs, signr, oldset, |
476 | (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL); | 476 | (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL); |
477 | if (err) | 477 | if (err) |
478 | return err; | 478 | return; |
479 | 479 | ||
480 | block_sigmask(ka, signr); | 480 | block_sigmask(ka, signr); |
481 | tracehook_signal_handler(signr, info, ka, regs, 0); | 481 | tracehook_signal_handler(signr, info, ka, regs, 0); |
482 | |||
483 | return 0; | ||
484 | } | 482 | } |
485 | 483 | ||
486 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, | 484 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, |
@@ -558,14 +556,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
558 | if (signr > 0) { | 556 | if (signr > 0) { |
559 | if (restart_syscall) | 557 | if (restart_syscall) |
560 | syscall_restart(orig_i0, regs, &ka.sa); | 558 | syscall_restart(orig_i0, regs, &ka.sa); |
561 | if (handle_signal(signr, &ka, &info, oldset, regs) == 0) { | 559 | handle_signal(signr, &ka, &info, oldset, regs); |
562 | /* A signal was successfully delivered; the saved | ||
563 | * sigmask will have been stored in the signal frame, | ||
564 | * and will be restored by sigreturn, so we can simply | ||
565 | * clear the TS_RESTORE_SIGMASK flag. | ||
566 | */ | ||
567 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | ||
568 | } | ||
569 | return; | 560 | return; |
570 | } | 561 | } |
571 | if (restart_syscall && | 562 | if (restart_syscall && |