+Tue Sep 25 02:09:42 2001 Christopher Faylor <cgf@redhat.com>
+
+ * select.cc (fhandler_tty_common::ready_for_read): Rewrite to correctly
+ call peek_pipe.
+
Mon Sep 24 18:46:39 2001 Christopher Faylor <cgf@cygnus.com>
* select.cc (peek_pipe): Only grab mutex when we actually got something
set_bits (me, readfds, writefds, exceptfds) :
0;
}
+
int
fhandler_pipe::ready_for_read (int fd, DWORD howlong, int ignra)
{
int
fhandler_tty_common::ready_for_read (int fd, DWORD howlong, int ignra)
{
-#if 0
- if (myself->pgid && get_ttyp ()->getpgid () != myself->pgid &&
- myself->ctty == ttynum) // background process?
- return 1; // Yes. Let read return an error
-#endif
- return ((fhandler_pipe*)this)->fhandler_pipe::ready_for_read (fd, howlong, ignra);
+ select_record me (this);
+ me.fd = fd;
+ (void) select_read (&me);
+ while (!peek_pipe (&me, ignra) && howlong == INFINITE)
+ if (fd >= 0 && cygheap->fdtab.not_open (fd))
+ break;
+ else if (WaitForSingleObject (signal_arrived, 10) == WAIT_OBJECT_0)
+ break;
+ select_printf ("returning %d", me.read_ready);
+ return me.read_ready;
}
select_record *