[PATCH] Remove duplicate code in signal.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

The following patch combines a bit of redundant code between
force_sig_info() and force_sig_specific().  Tested on x86 and ppc64.

Signed-off-by: [email protected]

---

 signal.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff -urpNa -X dontdiff linux-2.6.14-rc2-rt7/kernel/signal.c linux-2.6.14-rc2-rt7-force_sig/kernel/signal.c
--- linux-2.6.14-rc2-rt7/kernel/signal.c	2005-09-29 13:57:15.000000000 -0700
+++ linux-2.6.14-rc2-rt7-force_sig/kernel/signal.c	2005-09-29 18:41:07.000000000 -0700
@@ -920,8 +920,8 @@ force_sig_info(int sig, struct siginfo *
 	if (sigismember(&t->blocked, sig) || 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);
 	}
+	recalc_sigpending_tsk(t);
 	ret = specific_send_sig_info(sig, info, t);
 	spin_unlock_irqrestore(&t->sighand->siglock, flags);
 
@@ -931,15 +931,7 @@ force_sig_info(int sig, struct siginfo *
 void
 force_sig_specific(int sig, struct task_struct *t)
 {
-	unsigned long int flags;
-
-	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, (void *)2, t);
-	spin_unlock_irqrestore(&t->sighand->siglock, flags);
+	force_sig_info(sig, (void *)2, t);
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux