Commit b0423a0d authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Linus Torvalds

[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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ae6866c3
...@@ -879,11 +879,13 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) ...@@ -879,11 +879,13 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
int ret; int ret;
spin_lock_irqsave(&t->sighand->siglock, flags); spin_lock_irqsave(&t->sighand->siglock, flags);
if (sigismember(&t->blocked, sig) || t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) { if (t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) {
t->sighand->action[sig-1].sa.sa_handler = SIG_DFL; t->sighand->action[sig-1].sa.sa_handler = SIG_DFL;
}
if (sigismember(&t->blocked, sig)) {
sigdelset(&t->blocked, sig); sigdelset(&t->blocked, sig);
recalc_sigpending_tsk(t);
} }
recalc_sigpending_tsk(t);
ret = specific_send_sig_info(sig, info, t); ret = specific_send_sig_info(sig, info, t);
spin_unlock_irqrestore(&t->sighand->siglock, flags); spin_unlock_irqrestore(&t->sighand->siglock, flags);
...@@ -893,15 +895,7 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) ...@@ -893,15 +895,7 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
void void
force_sig_specific(int sig, struct task_struct *t) force_sig_specific(int sig, struct task_struct *t)
{ {
unsigned long int flags; force_sig_info(sig, SEND_SIG_FORCED, t);
spin_lock_irqsave(&t->sighand->siglock, flags);
if (t->sighand->action[sig-1].sa.sa_handler == SIG_IGN)
t->sighand->action[sig-1].sa.sa_handler = SIG_DFL;
sigdelset(&t->blocked, sig);
recalc_sigpending_tsk(t);
specific_send_sig_info(sig, SEND_SIG_FORCED, t);
spin_unlock_irqrestore(&t->sighand->siglock, flags);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment