From afa18d8a69f469b0bf2cd1da79d1ae93382129e5 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 19 Apr 2003 02:04:55 +0000 Subject: [PATCH] * fhandler_tty.cc (fhandler_tty_slave::open): Allocate a console whenever a pty is allocated. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_tty.cc | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f804da3eb..d1c9abe6f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-04-18 Christopher Faylor + + * fhandler_tty.cc (fhandler_tty_slave::open): Allocate a console + whenever a pty is allocated. + 2003-04-18 Christopher Faylor * Makefile.in: Use ${nostdlib} variable. diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 2361643d9..00147103a 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -554,7 +554,11 @@ fhandler_tty_slave::open (path_conv *, int flags, mode_t) set_open_status (); if (!output_done_event) { - fhandler_console::open_fhs++; + if (fhandler_console::open_fhs++ == 0) + { + BOOL b = AllocConsole (); + termios_printf ("%d = AllocConsole ()", b); + } termios_printf ("incremented open_fhs %d", fhandler_console::open_fhs); } termios_printf ("tty%d opened", ttynum);