summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/exec.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/podman/exec.go b/cmd/podman/exec.go
index 073e72e64..9e265b48c 100644
--- a/cmd/podman/exec.go
+++ b/cmd/podman/exec.go
@@ -109,5 +109,12 @@ func execCmd(c *cli.Context) error {
envs = append(envs, fmt.Sprintf("%s=%s", k, v))
}
- return ctr.Exec(c.Bool("tty"), c.Bool("privileged"), envs, cmd, c.String("user"), c.String("workdir"))
+ if err := ctr.Exec(c.Bool("tty"), c.Bool("privileged"), envs, cmd, c.String("user"), c.String("workdir")); err != nil {
+ if errors.Cause(err) == libpod.ErrCtrStateInvalid {
+ exitCode = 126
+ }
+ return err
+ }
+
+ return nil
}