mirror of
https://github.com/containers/podman.git
synced 2025-06-25 03:52:15 +08:00
StopContainer: small refactor
Move the stopSignal decl into the branch where it's actually used. [NO NEW TESTS NEEDED] as it's just a small refactor. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -400,12 +400,11 @@ func (r *ConmonOCIRuntime) StopContainer(ctr *Container, timeout uint, all bool)
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if timeout > 0 {
|
||||||
stopSignal := ctr.config.StopSignal
|
stopSignal := ctr.config.StopSignal
|
||||||
if stopSignal == 0 {
|
if stopSignal == 0 {
|
||||||
stopSignal = uint(syscall.SIGTERM)
|
stopSignal = uint(syscall.SIGTERM)
|
||||||
}
|
}
|
||||||
|
|
||||||
if timeout > 0 {
|
|
||||||
if err := r.KillContainer(ctr, stopSignal, all); err != nil {
|
if err := r.KillContainer(ctr, stopSignal, all); err != nil {
|
||||||
// Is the container gone?
|
// Is the container gone?
|
||||||
// If so, it probably died between the first check and
|
// If so, it probably died between the first check and
|
||||||
|
Reference in New Issue
Block a user