Skip to content

Commit

Permalink
signals: send_signal: be paranoid about signalfd_notify()
Browse files Browse the repository at this point in the history
send_signal() shouldn't call signalfd_notify() if it then fails with -EAGAIN.
Harmless, just a paranoid cleanup.

Also remove the comment.  It is obsolete, signalfd_notify() was simplified and
does a simple wakeup.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Davide Libenzi <davidel@xmailserver.org>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Apr 30, 2008
1 parent 021e1ae commit 53c3033
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,13 +772,6 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
*/
if (legacy_queue(pending, sig))
return 0;

/*
* Deliver the signal to listening signalfds. This must be called
* with the sighand lock held.
*/
signalfd_notify(t, sig);

/*
* fast-pathed signals for kernel-internal things like SIGSTOP
* or SIGKILL.
Expand Down Expand Up @@ -828,6 +821,7 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
}

out_set:
signalfd_notify(t, sig);
sigaddset(&pending->signal, sig);
complete_signal(sig, t, group);
return 0;
Expand Down

0 comments on commit 53c3033

Please sign in to comment.