diff options
author | Oleg Nesterov <oleg@redhat.com> | 2011-05-25 19:22:27 +0200 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2011-05-25 19:22:27 +0200 |
commit | d92fcf0552a15891b25c343cee340d295e24109c (patch) | |
tree | ad43a9c62d926f223d699544bcef4695af4f3e9d /kernel | |
parent | 0666fb51b1483f27506e212cc7f7b2645b5c7acc (diff) | |
download | op-kernel-dev-d92fcf0552a15891b25c343cee340d295e24109c.zip op-kernel-dev-d92fcf0552a15891b25c343cee340d295e24109c.tar.gz |
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: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/signal.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index ad5e818..86c32b8 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -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; } |