safing-portbase/modules/exit.go
2022-02-01 13:12:46 +01:00

14 lines
379 B
Go

package modules
var exitStatusCode int
// SetExitStatusCode sets the exit code that the program shell return to the host after shutdown.
func SetExitStatusCode(n int) {
exitStatusCode = n
}
// GetExitStatusCode waits for the shutdown to complete and then returns the previously set exit code.
func GetExitStatusCode() int {
<-shutdownCompleteSignal
return exitStatusCode
}