From 3bf693dde14b17e78ff99a0d04baf71841ae884c Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 5 Mar 2015 12:57:34 +0000 Subject: * 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. --- winsup/cygwin/fhandler.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 10eacd106..4ec7d02fa 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -414,6 +414,7 @@ public: virtual HANDLE& get_io_handle () { return io_handle; } virtual HANDLE& get_output_handle () { return io_handle; } virtual HANDLE get_stat_handle () { return pc.handle () ?: io_handle; } + virtual HANDLE get_echo_handle () const { return NULL; } virtual bool hit_eof () {return false;} virtual select_record *select_read (select_stuff *); virtual select_record *select_write (select_stuff *); @@ -1569,11 +1570,13 @@ class fhandler_pty_master: public fhandler_pty_common HANDLE master_ctl; // Control socket for handle duplication cygthread *master_thread; // Master control thread HANDLE from_master, to_master; + HANDLE echo_r, echo_w; DWORD dwProcessId; // Owner of master handles public: int need_nl; // Next read should start with \n + HANDLE get_echo_handle () const { return echo_r; } /* Constructor */ fhandler_pty_master (int); -- cgit v1.2.3