From 7a01aa546d49d670cb4c286752522850a81a2ccd Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 19 Dec 2005 19:04:14 +0000 Subject: * fhandler.h (set_console_state_for_spawn): Add an argument to the declaration. * fhandler_console.cc (set_console_state_for_spawn): Ditto for the definition. Only set invisible console for non-cygwin process. Remove debugging leftover. * spawn.cc (spawn_guts): Pass argument denoting whether this is a cygwin process to set_console_state_for_spawn and only call this function when exec'ing. --- winsup/cygwin/fhandler_console.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'winsup/cygwin/fhandler_console.cc') diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 460b0dd6b..3fd139deb 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -138,14 +138,13 @@ tty_list::get_tty (int n) return &nada; } - /* Determine if a console is associated with this process prior to a spawn. If it is, then we'll return 1. If the console has been initialized, then set it into a more friendly state for non-cygwin apps. */ void __stdcall -set_console_state_for_spawn () +set_console_state_for_spawn (bool noncygwin_process) { - if (fhandler_console::need_invisible ()) + if (noncygwin_process && fhandler_console::need_invisible ()) return; HANDLE h = CreateFile ("CONIN$", GENERIC_READ, FILE_SHARE_WRITE, @@ -1849,7 +1848,7 @@ fhandler_console::need_invisible () b = AllocConsole (); // will cause flashing if workstation // stuff fails debug_printf ("h (%p), horig (%p)", h, horig); - if (0 && horig && h && h != horig && SetProcessWindowStation (horig)) + if (horig && h && h != horig && SetProcessWindowStation (horig)) CloseHandle (h); termios_printf ("%d = AllocConsole (), %E", b); invisible_console = true; -- cgit v1.2.3