Skip to content

Commit cf8a8a0

Browse files
authored
Remove redundant addclose calls (#435)
We shouldn't need to use addclose on the file descriptors we're closing ourselves explicitly.
1 parent 353c863 commit cf8a8a0

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Sources/TSCBasic/Process.swift

-3
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,6 @@ 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])
690689
posix_spawn_file_actions_addclose(&fileActions, stdinPipe[1])
691690

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

701700
// Close the other ends of the pipe since they were dupped to 1.
702-
posix_spawn_file_actions_addclose(&fileActions, outputPipe[0])
703701
posix_spawn_file_actions_addclose(&fileActions, outputPipe[1])
704702

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

713711
// Close the other ends of the pipe since they were dupped to 2.
714-
posix_spawn_file_actions_addclose(&fileActions, stderrPipe[0])
715712
posix_spawn_file_actions_addclose(&fileActions, stderrPipe[1])
716713
}
717714
} else {

0 commit comments

Comments
 (0)