@@ -686,6 +686,7 @@ public final class Process {
686
686
posix_spawn_file_actions_adddup2 ( & fileActions, stdinPipe [ 0 ] , 0 )
687
687
688
688
// Close the other side's pipe since it was dupped to 0.
689
+ posix_spawn_file_actions_addclose ( & fileActions, stdinPipe [ 0 ] )
689
690
posix_spawn_file_actions_addclose ( & fileActions, stdinPipe [ 1 ] )
690
691
691
692
var outputPipe : [ Int32 ] = [ - 1 , - 1 ]
@@ -698,6 +699,7 @@ public final class Process {
698
699
posix_spawn_file_actions_adddup2 ( & fileActions, outputPipe [ 1 ] , 1 )
699
700
700
701
// Close the other ends of the pipe since they were dupped to 1.
702
+ posix_spawn_file_actions_addclose ( & fileActions, outputPipe [ 0 ] )
701
703
posix_spawn_file_actions_addclose ( & fileActions, outputPipe [ 1 ] )
702
704
703
705
if outputRedirection. redirectStderr {
@@ -709,6 +711,7 @@ public final class Process {
709
711
posix_spawn_file_actions_adddup2 ( & fileActions, stderrPipe [ 1 ] , 2 )
710
712
711
713
// Close the other ends of the pipe since they were dupped to 2.
714
+ posix_spawn_file_actions_addclose ( & fileActions, stderrPipe [ 0 ] )
712
715
posix_spawn_file_actions_addclose ( & fileActions, stderrPipe [ 1 ] )
713
716
}
714
717
} else {
0 commit comments