mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
0666fb51b1
commit
d92fcf0552
|
@ -3023,8 +3023,10 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
|
||||||
|
|
||||||
SYSCALL_DEFINE0(pause)
|
SYSCALL_DEFINE0(pause)
|
||||||
{
|
{
|
||||||
|
while (!signal_pending(current)) {
|
||||||
current->state = TASK_INTERRUPTIBLE;
|
current->state = TASK_INTERRUPTIBLE;
|
||||||
schedule();
|
schedule();
|
||||||
|
}
|
||||||
return -ERESTARTNOHAND;
|
return -ERESTARTNOHAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue