* fhandler.h (fhandler_pty_common::bytes_available): Declare new function.

(fhandler_pty_master::flush_to_slave): Ditto.
* fhandler_tty.cc (bytes_available): Define new function.
(fhandler_pty_common::bytes_available): Ditto.
(handler_pty_master::flush_to_slave): Ditto.
(fhandler_pty_master::process_slave_output): Call flush_to_slave () here.  Use
bytes_available () rather than PeekNamedPipe.  Cleanup sloppy logic.
(fhandler_pty_slave::read): Use bytes_available () rather than PeekNamedPipe.
(fhandler_pty_slave::ioctl): Ditto.
(fhandler_pty_master::ioctl): Ditto.
(fhandler_pty_master::cleanup): Remove ancient #if 0.
* select.cc (peek_pipe): Call flush_to_slave whenever we're checking for a pty
master.
This commit is contained in:
Christopher Faylor
2012-04-05 02:54:51 +00:00
parent ffcd2c3f89
commit 7b03b0d8ce
4 changed files with 99 additions and 71 deletions

View File

@@ -552,11 +552,15 @@ peek_pipe (select_record *s, bool from_select)
switch (fh->get_major ())
{
case DEV_PTYM_MAJOR:
if (((fhandler_pty_master *) fh)->need_nl)
{
gotone = s->read_ready = true;
goto out;
}
{
fhandler_pty_master *fhm = (fhandler_pty_master *) fh;
fhm->flush_to_slave ();
if (fhm->need_nl)
{
gotone = s->read_ready = true;
goto out;
}
}
break;
default:
if (fh->get_readahead_valid ())