UnixSignal: Add SIGCONT (#192)

I'm using swift-service-lifecycle's UnixSignal in a text UI library, and
needed SIGCONT. It's probably not super relevant in the service use
case, but it looks like UnixSignal is the best way to handle signals,
service or not, and I don't know if there's a downside to the library
supporting it?
This commit is contained in:
Juri Pakaste authored and GitHub committed 2024-12-10 10:07:22 +00:00
1 parent 0af4033d87
commit a6a4bc71cc
1 file changed
+6
+6
View File
@@ -37,6 +37,7 @@ public struct UnixSignal: Hashable, Sendable, CustomStringConvertible {
case sigalrm
case sigquit
case sigwinch
case sigcont
}
private let wrapped: Wrapped
@@ -71,6 +72,7 @@ public struct UnixSignal: Hashable, Sendable, CustomStringConvertible {
public static let sigalrm = Self(.sigalrm)
/// Signal when the window is resized.
public static let sigwinch = Self(.sigwinch)
public static let sigcont = Self(.sigcont)
}
extension UnixSignal.Wrapped: Hashable {}
@@ -101,6 +103,8 @@ extension UnixSignal.Wrapped: CustomStringConvertible {
return "SIGALRM"
case .sigwinch:
return "SIGWINCH"
case .sigcont:
return "SIGCONT"
}
}
}
@@ -130,6 +134,8 @@ extension UnixSignal.Wrapped {
return SIGALRM
case .sigwinch:
return SIGWINCH
case .sigcont:
return SIGCONT
}
}
}