Skip to content

Commit da1021a

Browse files
committed
Do not wait for child process to die before allowing non-killing signals to parent
1 parent db4a78a commit da1021a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let package = Package(
3838
res.append(.package(url: "https://github.com/Frizlab/UnwrapOrThrow.git", from: "1.0.1-rc"))
3939
res.append(.package(url: "https://github.com/xcode-actions/clt-logger.git", from: "0.5.1"))
4040
res.append(.package(url: "https://github.com/xcode-actions/stream-reader.git", from: "3.5.0"))
41-
res.append(.package(url: "https://github.com/xcode-actions/swift-signal-handling.git", from: "1.1.0"))
41+
res.append(.package(url: "https://github.com/xcode-actions/swift-signal-handling.git", from: "1.1.1"))
4242
#if !canImport(System)
4343
res.append(.package(url: "https://github.com/apple/swift-system.git", from: "1.0.0"))
4444
#endif

Sources/ProcessInvocation/ProcessInvocation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ public struct ProcessInvocation : AsyncSequence {
8080
public struct SignalHandling {
8181

8282
public var signalForChild: Signal?
83-
// public var signalForParent: Signal? /* Changing the signal is not possible w/ swift-signal-handling, but it’s not a big deal. */
83+
// public var signalForParent: Signal? /* Changing the signal is not possible w/ swift-signal-handling, but it’s not a big deal. It could be done but has not. */
8484
public var allowOnParent: Bool
8585
public var sendToProcessGroupOfChild: Bool
8686
public var waitForChildDeathBeforeSendingToParent: Bool
8787

8888
public static func `default`(for signal: Signal) -> Self {
89-
return .init(signalForChild: signal)
89+
return .init(signalForChild: signal, waitForChildDeathBeforeSendingToParent: Signal.killingSignals.contains(signal))
9090
}
9191

9292
public static func mapForChild(for signal: Signal, with map: [Signal: Signal]) -> Self {
93-
return .init(signalForChild: map[signal] ?? signal)
93+
return .default(for: map[signal] ?? signal)
9494
}
9595

9696
public init(signalForChild: Signal?, allowOnParent: Bool = true, sendToProcessGroupOfChild: Bool = true, waitForChildDeathBeforeSendingToParent: Bool = true) {

0 commit comments

Comments
 (0)