Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] Remove duplicate code in signal.c

Combine a bit of redundant code between force_sig_info() and
force_sig_specific().

Signed-off-by: paulmck@us.ibm.com
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Paul E. McKenney and committed by
Linus Torvalds
b0423a0d ae6866c3

+6 -12
+6 -12
kernel/signal.c
··· 879 879 int ret; 880 880 881 881 spin_lock_irqsave(&t->sighand->siglock, flags); 882 - if (sigismember(&t->blocked, sig) || t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) { 882 + if (t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) { 883 883 t->sighand->action[sig-1].sa.sa_handler = SIG_DFL; 884 - sigdelset(&t->blocked, sig); 885 - recalc_sigpending_tsk(t); 886 884 } 885 + if (sigismember(&t->blocked, sig)) { 886 + sigdelset(&t->blocked, sig); 887 + } 888 + recalc_sigpending_tsk(t); 887 889 ret = specific_send_sig_info(sig, info, t); 888 890 spin_unlock_irqrestore(&t->sighand->siglock, flags); 889 891 ··· 895 893 void 896 894 force_sig_specific(int sig, struct task_struct *t) 897 895 { 898 - unsigned long int flags; 899 - 900 - spin_lock_irqsave(&t->sighand->siglock, flags); 901 - if (t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) 902 - t->sighand->action[sig-1].sa.sa_handler = SIG_DFL; 903 - sigdelset(&t->blocked, sig); 904 - recalc_sigpending_tsk(t); 905 - specific_send_sig_info(sig, SEND_SIG_FORCED, t); 906 - spin_unlock_irqrestore(&t->sighand->siglock, flags); 896 + force_sig_info(sig, SEND_SIG_FORCED, t); 907 897 } 908 898 909 899 /*