From 570e1587dde267adea7fe460086dffee6aec83a4 Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Mon, 1 Feb 2021 20:21:03 +0100 Subject: Improve container libpod.Wait*() functions Signed-off-by: Matej Vasek --- libpod/container_internal.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libpod/container_internal.go') 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 -- cgit v1.2.3-54-g00ecf