check in missing file
This commit is contained in:
parent
8633e245b5
commit
9c9959a512
@ -690,13 +690,27 @@ int
|
|||||||
fhandler_pipe::ready_for_read (int fd, DWORD howlong)
|
fhandler_pipe::ready_for_read (int fd, DWORD howlong)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
if (howlong)
|
if (!howlong)
|
||||||
res = true;
|
|
||||||
else
|
|
||||||
res = fhandler_base::ready_for_read (fd, howlong);
|
res = fhandler_base::ready_for_read (fd, howlong);
|
||||||
|
else if (!get_guard ())
|
||||||
if (res)
|
res = 1;
|
||||||
get_guard ();
|
else
|
||||||
|
{
|
||||||
|
const HANDLE w4[2] = {get_guard (), signal_arrived};
|
||||||
|
switch (WaitForMultipleObjects (2, w4, 0, INFINITE))
|
||||||
|
{
|
||||||
|
case WAIT_OBJECT_0:
|
||||||
|
res = 1;
|
||||||
|
break;
|
||||||
|
case WAIT_OBJECT_0 + 1:
|
||||||
|
set_sig_errno (EINTR);
|
||||||
|
res = 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
__seterrno ();
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1164,7 +1178,7 @@ fhandler_serial::select_except (select_record *s)
|
|||||||
int
|
int
|
||||||
fhandler_base::ready_for_read (int fd, DWORD howlong)
|
fhandler_base::ready_for_read (int fd, DWORD howlong)
|
||||||
{
|
{
|
||||||
int avail = 0;
|
bool avail = false;
|
||||||
select_record me (this);
|
select_record me (this);
|
||||||
me.fd = fd;
|
me.fd = fd;
|
||||||
while (!avail)
|
while (!avail)
|
||||||
@ -1175,7 +1189,7 @@ fhandler_base::ready_for_read (int fd, DWORD howlong)
|
|||||||
if (fd >= 0 && cygheap->fdtab.not_open (fd))
|
if (fd >= 0 && cygheap->fdtab.not_open (fd))
|
||||||
{
|
{
|
||||||
set_sig_errno (EBADF);
|
set_sig_errno (EBADF);
|
||||||
avail = 0;
|
avail = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1190,7 +1204,7 @@ fhandler_base::ready_for_read (int fd, DWORD howlong)
|
|||||||
{
|
{
|
||||||
debug_printf ("interrupted");
|
debug_printf ("interrupted");
|
||||||
set_sig_errno (EINTR);
|
set_sig_errno (EINTR);
|
||||||
avail = 0;
|
avail = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user