mirror of
https://github.com/safing/portbase
synced 2025-09-01 10:09:50 +00:00
Add exit code mgmt to modules
This commit is contained in:
parent
2282c6bb71
commit
d6457348af
1 changed files with 16 additions and 0 deletions
16
modules/exit.go
Normal file
16
modules/exit.go
Normal 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
|
||||
}
|
Loading…
Add table
Reference in a new issue