* fhandler.h (class fhandler_base): Remove uninterruptible_io status
flag. (fhandler_base::ready_for_read): Remove declaration. (fhandler_socket::ready_for_read): Ditto. (fhandler_pipe::ready_for_read): Ditto. (fhandler_tty_master::is_slow): Remove. * fhandler_console.cc (fhandler_console::open): Drop setting uninterruptible_io. * fhandler_serial.cc (fhandler_serial::open): Ditto. * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Ditto. (fhandler_tty_master::init_console): Ditto. * pipe.cc (fhandler_pipe::fhandler_pipe): Ditto. (fhandler_pipe::open): Ditto. (_pipe): Ditto. * select.cc (fhandler_pipe::ready_for_read): Remove. (fhandler_base::ready_for_read): Remove. * syscalls.cc (readv): Drop unneeded wait variable. Remove entire test which might lead to calling ready_for_read. Remove now unused label out.
This commit is contained in:
@@ -694,17 +694,6 @@ pipe_cleanup (select_record *, select_stuff *stuff)
|
||||
stuff->device_specific_pipe = NULL;
|
||||
}
|
||||
|
||||
int
|
||||
fhandler_pipe::ready_for_read (int fd, DWORD howlong)
|
||||
{
|
||||
int res;
|
||||
if (!howlong)
|
||||
res = fhandler_base::ready_for_read (fd, howlong);
|
||||
else
|
||||
res = 1;
|
||||
return res;
|
||||
}
|
||||
|
||||
select_record *
|
||||
fhandler_pipe::select_read (select_stuff *ss)
|
||||
{
|
||||
@@ -1236,55 +1225,6 @@ fhandler_serial::select_except (select_stuff *ss)
|
||||
return s;
|
||||
}
|
||||
|
||||
int
|
||||
fhandler_base::ready_for_read (int fd, DWORD howlong)
|
||||
{
|
||||
bool avail = false;
|
||||
|
||||
select_stuff sel;
|
||||
fd_set *thisfd = allocfd_set (fd + 1);
|
||||
fd_set *dummy_writefds = allocfd_set (fd + 1);
|
||||
fd_set *dummy_exceptfds = allocfd_set (fd + 1);
|
||||
UNIX_FD_SET(fd, thisfd);
|
||||
|
||||
if (!sel.test_and_set (fd, thisfd, dummy_writefds, dummy_exceptfds))
|
||||
select_printf ("aborting due to test_and_set error");
|
||||
else
|
||||
{
|
||||
select_record *me = sel.start.next;
|
||||
while (!avail)
|
||||
{
|
||||
avail = me->read_ready ?: me->peek (me, false);
|
||||
|
||||
if (fd >= 0 && cygheap->fdtab.not_open (fd))
|
||||
{
|
||||
set_sig_errno (EBADF);
|
||||
avail = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (howlong != INFINITE)
|
||||
{
|
||||
if (!avail)
|
||||
set_sig_errno (EAGAIN);
|
||||
break;
|
||||
}
|
||||
|
||||
if (WaitForSingleObject (signal_arrived, avail ? 0 : 10) == WAIT_OBJECT_0)
|
||||
{
|
||||
debug_printf ("interrupted");
|
||||
set_sig_errno (EINTR);
|
||||
avail = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
select_printf ("read_ready %d, avail %d", sel.start.next->read_ready, avail);
|
||||
sel.cleanup ();
|
||||
return avail;
|
||||
}
|
||||
|
||||
select_record *
|
||||
fhandler_base::select_read (select_stuff *ss)
|
||||
{
|
||||
|
Reference in New Issue
Block a user