summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_tty.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-12-13 09:07:12 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-12-13 09:07:12 +0000
commit4c848934fea7f6da431ee6c136ce991cc55f1ceb (patch)
treec1a5de20a7c0a9d0297143484ce66289cd108f58 /winsup/cygwin/fhandler_tty.cc
parent82f423291b05df1f2553a87b22b5160e46b46356 (diff)
downloadcygnal-4c848934fea7f6da431ee6c136ce991cc55f1ceb.tar.gz
cygnal-4c848934fea7f6da431ee6c136ce991cc55f1ceb.tar.bz2
cygnal-4c848934fea7f6da431ee6c136ce991cc55f1ceb.zip
* fhandler_tty.cc (fhandler_tty::open): Close newly created window
station after switching to original window station.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r--winsup/cygwin/fhandler_tty.cc7
1 files changed, 5 insertions, 2 deletions
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);