From b2fb7c81b6c17b07f246704e56436749fdef8e0a Mon Sep 17 00:00:00 2001 From: Annalise Mariottini Date: Sun, 2 Jun 2024 18:22:23 -0400 Subject: [PATCH] close pipes after reading --- Sources/ShellOut.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/ShellOut.swift b/Sources/ShellOut.swift index 255c52c..981340f 100644 --- a/Sources/ShellOut.swift +++ b/Sources/ShellOut.swift @@ -438,6 +438,10 @@ private extension Process { #if !os(Linux) outputPipe.fileHandleForReading.readabilityHandler = nil errorPipe.fileHandleForReading.readabilityHandler = nil + if #available(macOS 10.15, *) { + try outputPipe.fileHandleForReading.close() + try errorPipe.fileHandleForReading.close() + } #endif // Block until all writes have occurred to outputData and errorData,