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:
parent
837eb2af5b
commit
704068e4f9
|
@ -112,13 +112,11 @@ fhandler_signalfd::read (void *ptr, size_t& len)
|
||||||
? (PLARGE_INTEGER) &poll : NULL);
|
? (PLARGE_INTEGER) &poll : NULL);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
{
|
{
|
||||||
if (curlen == 0)
|
/* If we already read a signal so the buffer isn't empty, just
|
||||||
{
|
return success. */
|
||||||
if (get_errno () == EINTR && curlen == 0)
|
if (curlen > 0)
|
||||||
continue;
|
break;
|
||||||
set_errno (old_errno);
|
len = -1;
|
||||||
}
|
|
||||||
len = curlen ?: (size_t) -1;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
__try
|
__try
|
||||||
|
|
Loading…
Reference in New Issue