* fhandler.h (fhandler_console::fixup_after_fork_exec): Define with additional

bool parameter.
(fhandler_console::fixup_after_exec): Accommodate fixup_after_fork_exec's
parameter.
(fhandler_console::fixup_after_fork): Ditto.
* fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Avoid opening
new console only when close_on_exec AND execing.
This commit is contained in:
Christopher Faylor
2005-11-14 14:15:51 +00:00
parent 5a0826c3f8
commit 548d0080af
3 changed files with 20 additions and 9 deletions

View File

@ -1769,12 +1769,12 @@ set_console_title (char *title)
}
void
fhandler_console::fixup_after_fork_exec ()
fhandler_console::fixup_after_fork_exec (bool execing)
{
HANDLE h = get_handle ();
HANDLE oh = get_output_handle ();
if (close_on_exec () || open (O_NOCTTY | get_flags (), 0))
if ((execing && close_on_exec ()) || open (O_NOCTTY | get_flags (), 0))
cygheap->manage_console_count ("fhandler_console::fixup_after_fork_exec", -1);
else
{