Skip to content

Commit

Permalink
signal: sys_pause() should check signal_pending()
Browse files Browse the repository at this point in the history
ERESTART* is always wrong without TIF_SIGPENDING. Teach sys_pause()
to handle the spurious wakeup correctly.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
  • Loading branch information
Oleg Nesterov committed May 25, 2011
1 parent 0666fb5 commit d92fcf0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -3023,8 +3023,10 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)

SYSCALL_DEFINE0(pause)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
while (!signal_pending(current)) {
current->state = TASK_INTERRUPTIBLE;
schedule();
}
return -ERESTARTNOHAND;
}

Expand Down

0 comments on commit d92fcf0

Please sign in to comment.