summaryrefslogtreecommitdiff
path: root/cmd/podman/main.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-09-07 05:40:45 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2019-09-12 16:20:01 -0400
commit535111b5d5cfa0d203df77e6d6b0b69eda46bb82 (patch)
treea22a31672391f8d2235fccaa891162a6f9467e7e /cmd/podman/main.go
parentaf8fedcc78674d71d43ca3000438c42b7b6b6994 (diff)
downloadpodman-535111b5d5cfa0d203df77e6d6b0b69eda46bb82.tar.gz
podman-535111b5d5cfa0d203df77e6d6b0b69eda46bb82.tar.bz2
podman-535111b5d5cfa0d203df77e6d6b0b69eda46bb82.zip
Use exit code constants
We have leaked the exit number codess all over the code, this patch removes the numbers to constants. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/main.go')
-rw-r--r--cmd/podman/main.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index 2b808b2bc..b83ccd9a5 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -8,6 +8,7 @@ import (
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/libpod"
+ "github.com/containers/libpod/libpod/define"
_ "github.com/containers/libpod/pkg/hooks/0.1.0"
"github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/version"
@@ -20,7 +21,7 @@ import (
// This is populated by the Makefile from the VERSION file
// in the repository
var (
- exitCode = 125
+ exitCode = define.ExecErrorCodeGeneric
Ctx context.Context
span opentracing.Span
closer io.Closer
@@ -152,11 +153,12 @@ func main() {
if err := rootCmd.Execute(); err != nil {
outputError(err)
} else {
- // The exitCode modified from 125, indicates an application
+ // The exitCode modified from define.ExecErrorCodeGeneric,
+ // 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 {
+ if exitCode == define.ExecErrorCodeGeneric {
exitCode = 0
}