diff options
author | Matej Vasek <mvasek@redhat.com> | 2021-02-01 20:21:03 +0100 |
---|---|---|
committer | Matej Vasek <mvasek@redhat.com> | 2021-02-03 21:49:09 +0100 |
commit | 570e1587dde267adea7fe460086dffee6aec83a4 (patch) | |
tree | 8b7570ae70bab43ceea4709c672adb3bc82cf80b /libpod/container_internal.go | |
parent | 4e1bcf30f3a519490f58d66bc0aef16676f61ae8 (diff) | |
download | podman-570e1587dde267adea7fe460086dffee6aec83a4.tar.gz podman-570e1587dde267adea7fe460086dffee6aec83a4.tar.bz2 podman-570e1587dde267adea7fe460086dffee6aec83a4.zip |
Improve container libpod.Wait*() functions
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index b9ea50783..5a61f7fe6 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -754,17 +754,17 @@ func (c *Container) getArtifactPath(name string) string { } // Used with Wait() to determine if a container has exited -func (c *Container) isStopped() (bool, error) { +func (c *Container) isStopped() (bool, int32, error) { if !c.batched { c.lock.Lock() defer c.lock.Unlock() } err := c.syncContainer() if err != nil { - return true, err + return true, -1, err } - return !c.ensureState(define.ContainerStateRunning, define.ContainerStatePaused, define.ContainerStateStopping), nil + return !c.ensureState(define.ContainerStateRunning, define.ContainerStatePaused, define.ContainerStateStopping), c.state.ExitCode, nil } // save container state to the database |