From 4c848934fea7f6da431ee6c136ce991cc55f1ceb Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 13 Dec 2005 09:07:12 +0000 Subject: * fhandler_tty.cc (fhandler_tty::open): Close newly created window station after switching to original window station. --- winsup/cygwin/fhandler_tty.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/fhandler_tty.cc') diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 47ba20720..0e451b482 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -605,8 +605,11 @@ fhandler_tty_slave::open (int flags, mode_t) } b = AllocConsole (); // will cause flashing if workstation // stuff fails - if (horig && h != horig) - SetProcessWindowStation (horig); + if (horig && h && h != horig) + { + SetProcessWindowStation (horig); + CloseHandle (h); + } termios_printf ("%d = AllocConsole (), %E", b); if (b) init_console_handler (TRUE); -- cgit v1.2.3