* 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

@ -1433,6 +1433,7 @@ class fhandler_pty_common: public fhandler_termios
int close ();
_off64_t lseek (_off64_t, int);
bool bytes_available (DWORD& n);
void set_close_on_exec (bool val);
select_record *select_read (select_stuff *);
select_record *select_write (select_stuff *);
@ -1549,6 +1550,7 @@ public:
void fixup_after_fork (HANDLE parent);
void fixup_after_exec ();
int tcgetpgrp ();
void flush_to_slave ();
fhandler_pty_master (void *) {}
~fhandler_pty_master ();