mirror of
https://github.com/apple/container.git
synced 2026-09-27 18:15:37 +00:00
Adds public init for ExitStatus. (#305)
Client code may want to return ExitStatus from functions that return a containerization process return code, or -1 for caught exceptions.
This commit is contained in:
@@ -23,4 +23,14 @@ public struct ExitStatus: Sendable {
|
||||
public var exitCode: Int32
|
||||
/// The timestamp when the process exited.
|
||||
public var exitedAt: Date
|
||||
|
||||
public init(exitCode: Int32) {
|
||||
self.exitCode = exitCode
|
||||
self.exitedAt = .now
|
||||
}
|
||||
|
||||
public init(exitCode: Int32, exitedAt: Date) {
|
||||
self.exitCode = exitCode
|
||||
self.exitedAt = exitedAt
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user