Skip to content

Commit 4d539ff

Browse files
authored
Revert "Remove redundant addclose calls (#435)" (#438)
This reverts commit cf8a8a0.
1 parent cf8a8a0 commit 4d539ff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/TSCBasic/Process.swift

+3
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ public final class Process {
686686
posix_spawn_file_actions_adddup2(&fileActions, stdinPipe[0], 0)
687687

688688
// Close the other side's pipe since it was dupped to 0.
689+
posix_spawn_file_actions_addclose(&fileActions, stdinPipe[0])
689690
posix_spawn_file_actions_addclose(&fileActions, stdinPipe[1])
690691

691692
var outputPipe: [Int32] = [-1, -1]
@@ -698,6 +699,7 @@ public final class Process {
698699
posix_spawn_file_actions_adddup2(&fileActions, outputPipe[1], 1)
699700

700701
// Close the other ends of the pipe since they were dupped to 1.
702+
posix_spawn_file_actions_addclose(&fileActions, outputPipe[0])
701703
posix_spawn_file_actions_addclose(&fileActions, outputPipe[1])
702704

703705
if outputRedirection.redirectStderr {
@@ -709,6 +711,7 @@ public final class Process {
709711
posix_spawn_file_actions_adddup2(&fileActions, stderrPipe[1], 2)
710712

711713
// Close the other ends of the pipe since they were dupped to 2.
714+
posix_spawn_file_actions_addclose(&fileActions, stderrPipe[0])
712715
posix_spawn_file_actions_addclose(&fileActions, stderrPipe[1])
713716
}
714717
} else {

0 commit comments

Comments
 (0)