diff options
author | Christopher Faylor <me@cgf.cx> | 2005-12-19 04:34:13 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-12-19 04:34:13 +0000 |
commit | 65438ec635d9cede44bb9e59438f80668422d704 (patch) | |
tree | 7f7d9c84558ab4b6ae8868b05cf49e51c8f69b4f /winsup/cygwin/pipe.cc | |
parent | ca9271d1b6c70a60640e32a2cdb729d51e2037e7 (diff) | |
download | cygnal-65438ec635d9cede44bb9e59438f80668422d704.tar.gz cygnal-65438ec635d9cede44bb9e59438f80668422d704.tar.bz2 cygnal-65438ec635d9cede44bb9e59438f80668422d704.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/pipe.cc')
-rw-r--r-- | winsup/cygwin/pipe.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc index 440e70396..a01a2dc39 100644 --- a/winsup/cygwin/pipe.cc +++ b/winsup/cygwin/pipe.cc @@ -224,7 +224,7 @@ fhandler_pipe::hit_eof () } void -fhandler_pipe::fixup_after_exec () +fhandler_pipe::fixup_in_child () { if (read_state) { @@ -234,6 +234,13 @@ fhandler_pipe::fixup_after_exec () } void +fhandler_pipe::fixup_after_exec () +{ + if (!close_on_exec ()) + fixup_in_child (); +} + +void fhandler_pipe::fixup_after_fork (HANDLE parent) { fhandler_base::fixup_after_fork (parent); @@ -241,7 +248,7 @@ fhandler_pipe::fixup_after_fork (HANDLE parent) fork_fixup (parent, guard, "guard"); if (writepipe_exists) fork_fixup (parent, writepipe_exists, "guard"); - fixup_after_exec (); + fixup_in_child (); } int |