]> err.no Git - linux-2.6/commitdiff
do_sigaction: don't worry about signal_pending()
authorOleg Nesterov <oleg@tv-sign.ru>
Wed, 17 Oct 2007 06:27:24 +0000 (23:27 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:42:54 +0000 (08:42 -0700)
do_sigaction() returns -ERESTARTNOINTR if signal_pending(). The comment says:

* If there might be a fatal signal pending on multiple
* threads, make sure we take it before changing the action.

I think this is not needed. We should only worry about SIGNAL_GROUP_EXIT case,
bit it implies a pending SIGKILL which can't be cleared by do_sigaction.

Kill this special case.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/signal.c

index 90e2efad33ae00b5c949bab04107a86f3baa0e13..2124ffadcfdefff5a6cf0fbc2da37c3ac19d8a44 100644 (file)
@@ -2294,15 +2294,6 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
        k = &current->sighand->action[sig-1];
 
        spin_lock_irq(&current->sighand->siglock);
-       if (signal_pending(current)) {
-               /*
-                * If there might be a fatal signal pending on multiple
-                * threads, make sure we take it before changing the action.
-                */
-               spin_unlock_irq(&current->sighand->siglock);
-               return -ERESTARTNOINTR;
-       }
-
        if (oact)
                *oact = *k;