diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-02 09:59:21 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:58:48 -0400 |
commit | b7f9a11a6cf1ea9ee6be3eb2b90d91327a09ad14 (patch) | |
tree | 7d5a5f469aea8ac2b3e1ab41e05a6abafcb2b694 /arch/cris/arch-v32 | |
parent | 51a7b448d4134e3e8eec633435e3e8faee14a828 (diff) |
new helper: sigmask_to_save()
replace boilerplate "should we use ->saved_sigmask or ->blocked?"
with calls of obvious inlined helper...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/cris/arch-v32')
-rw-r--r-- | arch/cris/arch-v32/kernel/signal.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c index fe12cdca0bac..d52276ddae4b 100644 --- a/arch/cris/arch-v32/kernel/signal.c +++ b/arch/cris/arch-v32/kernel/signal.c | |||
@@ -437,8 +437,9 @@ give_sigsegv: | |||
437 | static inline int | 437 | static inline int |
438 | handle_signal(int canrestart, unsigned long sig, | 438 | handle_signal(int canrestart, unsigned long sig, |
439 | siginfo_t *info, struct k_sigaction *ka, | 439 | siginfo_t *info, struct k_sigaction *ka, |
440 | sigset_t *oldset, struct pt_regs * regs) | 440 | struct pt_regs * regs) |
441 | { | 441 | { |
442 | sigset_t *oldset = sigmask_to_save(); | ||
442 | int ret; | 443 | int ret; |
443 | 444 | ||
444 | /* Check if this got called from a system call. */ | 445 | /* Check if this got called from a system call. */ |
@@ -511,7 +512,6 @@ do_signal(int canrestart, struct pt_regs *regs) | |||
511 | int signr; | 512 | int signr; |
512 | siginfo_t info; | 513 | siginfo_t info; |
513 | struct k_sigaction ka; | 514 | struct k_sigaction ka; |
514 | sigset_t *oldset; | ||
515 | 515 | ||
516 | /* | 516 | /* |
517 | * The common case should go fast, which is why this point is | 517 | * The common case should go fast, which is why this point is |
@@ -521,17 +521,12 @@ do_signal(int canrestart, struct pt_regs *regs) | |||
521 | if (!user_mode(regs)) | 521 | if (!user_mode(regs)) |
522 | return; | 522 | return; |
523 | 523 | ||
524 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
525 | oldset = ¤t->saved_sigmask; | ||
526 | else | ||
527 | oldset = ¤t->blocked; | ||
528 | |||
529 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 524 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
530 | 525 | ||
531 | if (signr > 0) { | 526 | if (signr > 0) { |
532 | /* Whee! Actually deliver the signal. */ | 527 | /* Whee! Actually deliver the signal. */ |
533 | if (handle_signal(canrestart, signr, &info, &ka, | 528 | if (handle_signal(canrestart, signr, &info, &ka, |
534 | oldset, regs)) { | 529 | regs)) { |
535 | /* a signal was successfully delivered; the saved | 530 | /* a signal was successfully delivered; the saved |
536 | * sigmask will have been stored in the signal frame, | 531 | * sigmask will have been stored in the signal frame, |
537 | * and will be restored by sigreturn, so we can simply | 532 | * and will be restored by sigreturn, so we can simply |