From 8b4311ed4904da2a19c9b05240a10cb43e1478f2 Mon Sep 17 00:00:00 2001 From: cgf Date: Sat, 7 Jun 2003 15:12:23 +0000 Subject: [PATCH] * fhandler_tty.cc (fhandler_tty_slave::close): Free the console when last tty closes. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_tty.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 94ec37845a..2c146ab964 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-06-07 Christopher Faylor + + * fhandler_tty.cc (fhandler_tty_slave::close): Free the console when + last tty closes. + 2003-06-07 Thomas Pfaff * fhandler_socket.cc (fhandler_socket::connect): Change error diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 6285b24bdf..6409090e95 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -583,7 +583,8 @@ fhandler_tty_slave::close () { if (!output_done_event) { - fhandler_console::open_fhs--; + if (!--fhandler_console::open_fhs && myself->ctty == -1) + FreeConsole (); termios_printf ("decremented open_fhs %d", fhandler_console::open_fhs); } return fhandler_tty_common::close (); -- 2.11.0