diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-03-05 12:57:34 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-03-05 12:57:34 +0000 |
commit | 3bf693dde14b17e78ff99a0d04baf71841ae884c (patch) | |
tree | 2b0d5a8d2745410b2a82b052b5cf539019ec31cb /winsup/cygwin/select.cc | |
parent | e185d3febe74ca06add356d5e922b7c0e8475329 (diff) | |
download | cygnal-3bf693dde14b17e78ff99a0d04baf71841ae884c.tar.gz cygnal-3bf693dde14b17e78ff99a0d04baf71841ae884c.tar.bz2 cygnal-3bf693dde14b17e78ff99a0d04baf71841ae884c.zip |
* fhandler.h (fhandler_base::get_echo_handle): New virtual method.
(class fhandler_pty_master): Add echo_r and echo_w handles constituting
read and write side of new echo pipe.
* select.cc (peek_pipe): On pty masters, check additionally if input
from the echo pipe is available.
* fhandler_tty.cc (fhandler_pty_master::doecho): Drop output_mutex
locking. Write output to echo pipe.
(fhandler_pty_master::process_slave_output): Check if input is available
in echo pipe and prefer to read from it, if so.
(fhandler_pty_slave::write): Drop output_mutex locking.
(fhandler_pty_master::fhandler_pty_master): Initialize echo pipe
handles to NULL.
(fhandler_pty_master::close): Close and NULL echo pipe handles.
(fhandler_pty_master::setup): Create echo pipe, close in case of error.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r-- | winsup/cygwin/select.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index c72cd0c76..17a32a367 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -1,7 +1,7 @@ /* select.cc Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc. + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -626,6 +626,9 @@ peek_pipe (select_record *s, bool from_select) goto out; } int n = pipe_data_available (s->fd, fh, h, false); + /* On PTY masters, check if input from the echo pipe is available. */ + if (n == 0 && fh->get_echo_handle ()) + n = pipe_data_available (s->fd, fh, fh->get_echo_handle (), false); if (n < 0) { |