Skip to content

Commit d224aec

Browse files
committed
Fix fd whose fg pg id is set when input redirect is not from the normal stdin
1 parent 2605b32 commit d224aec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/ProcessInvocation/ProcessInvocation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ public struct ProcessInvocation : AsyncSequence {
466466
assert(fileDescriptorsToSend.isEmpty, "Giving ownership to fd on stdin is not allowed when launching the process via the bridge. This is because stdin has to be sent via the bridge and we get only pain and race conditions to properly close the fd.")
467467
fdsToCloseAfterRun.insert(fd)
468468
}
469-
fdWhoseFgPgIDShouldBeSet = (setFgPgID ? FileDescriptor.standardInput : nil)
469+
fdWhoseFgPgIDShouldBeSet = (setFgPgID ? fd : nil)
470470

471471
case .sendFromReader(let reader):
472472
assert(fileDescriptorsToSend.isEmpty, "Sending data to stdin via a reader is not allowed when launching the process via the bridge. This is because stdin has to be sent via the bridge and we get only pain and race conditions to properly close the fd.")

0 commit comments

Comments
 (0)