Add exit code mgmt to modules

This commit is contained in:
Daniel 2019-10-09 16:35:50 +02:00
parent 2282c6bb71
commit d6457348af

16
modules/exit.go Normal file
View file

@ -0,0 +1,16 @@
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 exit code
func GetExitStatusCode() int {
<-shutdownCompleteSignal
return exitStatusCode
}