* select.cc (fhandler_tty_common::ready_for_read): Rewrite to correctly

call peek_pipe.
This commit is contained in:
Christopher Faylor 2001-09-25 06:19:10 +00:00
parent 54e909976c
commit 79776fc2cc
2 changed files with 16 additions and 6 deletions

View File

@ -1,3 +1,8 @@
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> Mon Sep 24 18:46:39 2001 Christopher Faylor <cgf@cygnus.com>
* select.cc (peek_pipe): Only grab mutex when we actually got something * select.cc (peek_pipe): Only grab mutex when we actually got something

View File

@ -496,6 +496,7 @@ poll_pipe (select_record *me, fd_set *readfds, fd_set *writefds,
set_bits (me, readfds, writefds, exceptfds) : set_bits (me, readfds, writefds, exceptfds) :
0; 0;
} }
int int
fhandler_pipe::ready_for_read (int fd, DWORD howlong, int ignra) fhandler_pipe::ready_for_read (int fd, DWORD howlong, int ignra)
{ {
@ -745,12 +746,16 @@ fhandler_console::select_except (select_record *s)
int int
fhandler_tty_common::ready_for_read (int fd, DWORD howlong, int ignra) fhandler_tty_common::ready_for_read (int fd, DWORD howlong, int ignra)
{ {
#if 0 select_record me (this);
if (myself->pgid && get_ttyp ()->getpgid () != myself->pgid && me.fd = fd;
myself->ctty == ttynum) // background process? (void) select_read (&me);
return 1; // Yes. Let read return an error while (!peek_pipe (&me, ignra) && howlong == INFINITE)
#endif if (fd >= 0 && cygheap->fdtab.not_open (fd))
return ((fhandler_pipe*)this)->fhandler_pipe::ready_for_read (fd, howlong, ignra); break;
else if (WaitForSingleObject (signal_arrived, 10) == WAIT_OBJECT_0)
break;
select_printf ("returning %d", me.read_ready);
return me.read_ready;
} }
select_record * select_record *