mirror of
https://github.com/containers/podman.git
synced 2025-12-11 17:27:19 +08:00
Record whether the container has exited
Use this to supplement exit codes returned from containers, to make sure we know when exit codes are invalid (as the container has not yet exited) Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
@@ -75,7 +75,7 @@ func BatchContainerOp(ctr *libpod.Container, opts PsOptions) (BatchContainerStru
|
||||
return errors.Wrapf(err, "unable to obtain container state")
|
||||
}
|
||||
|
||||
exitCode, err = c.ExitCode()
|
||||
exitCode, _, err = c.ExitCode()
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "unable to obtain container exit code")
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ func generateContainerFilterFuncs(filter, filterValue string, runtime *libpod.Ru
|
||||
return nil, errors.Wrapf(err, "exited code out of range %q", filterValue)
|
||||
}
|
||||
return func(c *libpod.Container) bool {
|
||||
ec, err := c.ExitCode()
|
||||
ec, _, err := c.ExitCode()
|
||||
if ec == int32(exitCode) && err == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user