Skip to content

Commit 7b80249

Browse files
committed
Fix to #435 (wrong stdin fd closed.)
(With apologies to @neonichu.) The previous commit closes the wrong file descriptor for `stdin`, which should close the duplicated _read_ descriptor (whereas `stdout` and `stderr` duplicate their _write_ descriptors.) This PR fixes that.
1 parent 0dc3ba4 commit 7b80249

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/TSCBasic/Process.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -686,7 +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[1])
689+
posix_spawn_file_actions_addclose(&fileActions, stdinPipe[0])
690690

691691
var outputPipe: [Int32] = [-1, -1]
692692
var stderrPipe: [Int32] = [-1, -1]

0 commit comments

Comments
 (0)