summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
Diffstat (limited to 'libpod')
-rw-r--r--libpod/oci_conmon_common.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/libpod/oci_conmon_common.go b/libpod/oci_conmon_common.go
index 87f0aa4ad..0c61de360 100644
--- a/libpod/oci_conmon_common.go
+++ b/libpod/oci_conmon_common.go
@@ -429,13 +429,11 @@ func (r *ConmonOCIRuntime) StopContainer(ctr *Container, timeout uint, all bool)
}
}
- if err := r.KillContainer(ctr, 9, all); err != nil {
+ if err := r.KillContainer(ctr, uint(unix.SIGKILL), all); err != nil {
// Again, check if the container is gone. If it is, exit cleanly.
- err := unix.Kill(ctr.state.PID, 0)
- if err == unix.ESRCH {
+ if aliveErr := unix.Kill(ctr.state.PID, 0); errors.Is(aliveErr, unix.ESRCH) {
return nil
}
-
return fmt.Errorf("error sending SIGKILL to container %s: %w", ctr.ID(), err)
}