mirror of
https://github.com/containers/podman.git
synced 2025-12-08 14:48:48 +08:00
Fix handling of exit codes
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #183 Approved by: TomSweeneyRedHat
This commit is contained in:
committed by
Atomic Bot
parent
137e5c8ffd
commit
b231e3412e
@@ -13,7 +13,10 @@ import (
|
||||
|
||||
// This is populated by the Makefile from the VERSION file
|
||||
// in the repository
|
||||
var podmanVersion = ""
|
||||
var (
|
||||
podmanVersion = ""
|
||||
exitCode = 125
|
||||
)
|
||||
|
||||
func main() {
|
||||
debug := false
|
||||
@@ -152,5 +155,14 @@ func main() {
|
||||
} else {
|
||||
fmt.Fprintln(os.Stderr, err.Error())
|
||||
}
|
||||
} else {
|
||||
// The exitCode modified from 125, indicates an application
|
||||
// running inside of a container failed, as opposed to the
|
||||
// podman command failed. Must exit with that exit code
|
||||
// otherwise command exited correctly.
|
||||
if exitCode == 125 {
|
||||
exitCode = 0
|
||||
}
|
||||
}
|
||||
os.Exit(exitCode)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user