Cygwin: signalfd: drop incorrect handling of EINTR in read(2)

In case sigwait_common returns EINTR, read wrongly ignores it,
so read can't be interrupt by a signal.  Fix that.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2019-01-15 09:58:30 +01:00
parent 837eb2af5b
commit 704068e4f9
1 changed files with 5 additions and 7 deletions

View File

@ -112,13 +112,11 @@ fhandler_signalfd::read (void *ptr, size_t& len)
? (PLARGE_INTEGER) &poll : NULL);
if (ret == -1)
{
if (curlen == 0)
{
if (get_errno () == EINTR && curlen == 0)
continue;
set_errno (old_errno);
}
len = curlen ?: (size_t) -1;
/* If we already read a signal so the buffer isn't empty, just
return success. */
if (curlen > 0)
break;
len = -1;
return;
}
__try