summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>2020-05-19 20:35:59 +0900
committerCorinna Vinschen <corinna@vinschen.de>2020-05-19 15:28:21 +0200
commit0365031ce1347600d854a23f30f1355745a1765c (patch)
tree95e3ed790b167e7934bc069b04109b65fd9bb399
parent7659ff0f5afd751f42485f2684c799c5f37b0fb9 (diff)
downloadcygnal-0365031ce1347600d854a23f30f1355745a1765c.tar.gz
cygnal-0365031ce1347600d854a23f30f1355745a1765c.tar.bz2
cygnal-0365031ce1347600d854a23f30f1355745a1765c.zip
Cygwin: pty: Make system_printf() work after closing pty slave.
- Current pty cannot show system_printf() output after closing pty slave. This patch fixes the issue.
-rw-r--r--winsup/cygwin/fhandler_tty.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 5a1bcd3ce..02b78cd2c 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -948,6 +948,10 @@ fhandler_pty_slave::open (int flags, mode_t)
init_console_handler (true);
}
+ get_ttyp ()->pcon_pid = 0;
+ get_ttyp ()->switch_to_pcon_in = false;
+ get_ttyp ()->switch_to_pcon_out = false;
+
set_open_status ();
return 1;
@@ -1008,6 +1012,7 @@ fhandler_pty_slave::close ()
termios_printf ("CloseHandle (output_mutex<%p>), %E", output_mutex);
if (pcon_attached_to == get_minor ())
get_ttyp ()->num_pcon_attached_slaves --;
+ set_switch_to_pcon (2); /* Make system_printf() work after close. */
return 0;
}