From 65438ec635d9cede44bb9e59438f80668422d704 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 19 Dec 2005 04:34:13 +0000 Subject: * fhandler.h (fhandler_pipe::fixup_in_child): Declare new function. (fhandler_console::invisible_console): Declare new variable. (fhandler_console::need_invisible): Ditto. (fhandler_console::has_a): Ditto. * fhandler_console.cc (set_console_state_for_spawn): Eliminate return value. Set up an invisible console if necessary prior to spawning. (fhandler_console::invisible_console): Define. * fhandler_tty.cc (fhandler_tty_slave::open): Use fhandler_console::invisible_console to setup an invisible console. * pipe.cc (fhandler_pipe::fixup_in_child): Define new function from fixup_after_exec. (fhandler_pipe::fixup_after_exec): Use fixup_in_child when appropriate. (fhandler_pipe::fixup_after_fork): Ditto. * spawn.cc (handle): Reorganize and modernize a little. (spawn_guts): Rely on set_console_state_for_spawn to set the console into the right state but don't create the process with "detached" flag if we have no controlling tty since that confuses 'cmd'. * dtable.cc (dtable::stdio_init): Don't set console as controlling terminal if we have an invisible console. * sigproc.cc (child_info::sync): Use correct name in ForceCloseHandle1. --- winsup/cygwin/dtable.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/dtable.cc') diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 08832a6a5..31b119871 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -160,9 +160,10 @@ dtable::stdio_init () init_std_file_from_handle (1, out); init_std_file_from_handle (2, err); + /* Assign the console as the controlling tty for this process if we actually have a console and no other controlling tty has been assigned. */ - if (myself->ctty < 0 && GetConsoleCP () > 0) + if (!fhandler_console::need_invisible () && myself->ctty < 0) set_console_ctty (); } -- cgit v1.2.3