aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/pipe.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/pipe.cc')
-rw-r--r--winsup/cygwin/pipe.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc
index 440e703..a01a2dc 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