Skip to content

Commit 4275315

Browse files
committed
Foundation: fix Process.run() handle handling for Windows
Do not close both sides of the pipe. The pipes are half-duplex and the parent side of the pipe need to be valid to permit communication with the child.
1 parent f4c37de commit 4275315

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Foundation/Process.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,12 @@ open class Process: NSObject {
519519

520520
if let pipe = standardInput as? Pipe {
521521
pipe.fileHandleForReading.closeFile()
522-
pipe.fileHandleForWriting.closeFile()
523522
}
524523
if let pipe = standardOutput as? Pipe {
525-
pipe.fileHandleForReading.closeFile()
526524
pipe.fileHandleForWriting.closeFile()
527525
}
528526
if let pipe = standardError as? Pipe {
529527
pipe.fileHandleForWriting.closeFile()
530-
pipe.fileHandleForReading.closeFile()
531528
}
532529

533530
self.runLoop = RunLoop.current

0 commit comments

Comments
 (0)