Commit d92fcf05 authored by Oleg Nesterov's avatar Oleg Nesterov

signal: sys_pause() should check signal_pending()

ERESTART* is always wrong without TIF_SIGPENDING. Teach sys_pause()
to handle the spurious wakeup correctly.
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
parent 0666fb51
...@@ -3023,8 +3023,10 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler) ...@@ -3023,8 +3023,10 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
SYSCALL_DEFINE0(pause) SYSCALL_DEFINE0(pause)
{ {
current->state = TASK_INTERRUPTIBLE; while (!signal_pending(current)) {
schedule(); current->state = TASK_INTERRUPTIBLE;
schedule();
}
return -ERESTARTNOHAND; return -ERESTARTNOHAND;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment