diff options
author | Christopher Faylor <me@cgf.cx> | 2012-04-05 06:54:51 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-04-05 06:54:51 +0400 |
commit | 7b03b0d8cee0ab8ef442d0d1ed2031f77207557a (patch) | |
tree | 4cb0a3863b4e702b974fe86fe483c73ab3465dc6 /winsup/cygwin/select.cc | |
parent | ffcd2c3f894413870b4431677d94044ca0336c1b (diff) |
* 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.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r-- | winsup/cygwin/select.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 72900866e..85753e817 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -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 ()) |