summaryrefslogtreecommitdiff
path: root/cmd/podman/main.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-01-04 08:53:46 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-04 21:05:10 +0000
commitb231e3412e7d37d9680229e3782e28161792c7f8 (patch)
treeda0d214d45bbb13b3254dfe450b73ddc24e44351 /cmd/podman/main.go
parent137e5c8ffd5e1d7abe47398d909c9611f19bfcbb (diff)
downloadpodman-b231e3412e7d37d9680229e3782e28161792c7f8.tar.gz
podman-b231e3412e7d37d9680229e3782e28161792c7f8.tar.bz2
podman-b231e3412e7d37d9680229e3782e28161792c7f8.zip
Fix handling of exit codes
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #183 Approved by: TomSweeneyRedHat
Diffstat (limited to 'cmd/podman/main.go')
-rw-r--r--cmd/podman/main.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index b27409e4c..0fd30fa71 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -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)
}