Skip to content

Commit

Permalink
signals: send_sigqueue: don't forget about handle_stop_signal()
Browse files Browse the repository at this point in the history
send_group_sigqueue() calls handle_stop_signal(), send_sigqueue() doesn't.
This is not consistent and in fact I'd say this is (minor) bug.

Move handle_stop_signal() from send_group_sigqueue() to do_send_sigqueue(),
the latter is called by send_sigqueue() too.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
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 5c193e8 commit 5fc894b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1274,8 +1274,10 @@ void sigqueue_free(struct sigqueue *q)
}

static int do_send_sigqueue(int sig, struct sigqueue *q, struct task_struct *t,
struct sigpending *pending)
struct sigpending *pending)
{
handle_stop_signal(sig, t);

if (unlikely(!list_empty(&q->list))) {
/*
* If an SI_TIMER entry is already queue just increment
Expand Down Expand Up @@ -1335,7 +1337,6 @@ send_group_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)
read_lock(&tasklist_lock);
/* Since it_lock is held, p->sighand cannot be NULL. */
spin_lock_irqsave(&p->sighand->siglock, flags);
handle_stop_signal(sig, p);

ret = do_send_sigqueue(sig, q, p, &p->signal->shared_pending);

Expand Down

0 comments on commit 5fc894b

Please sign in to comment.