mirror of
https://github.com/docker/cli.git
synced 2026-01-18 08:21:31 +03:00
Merge pull request #17923 from LK4D4/simple_ckill
daemon/kill.go: simplify if statement Upstream-commit: b6899ad56fd4cd1636642c58fb7f7bc161fddef6 Component: engine
This commit is contained in:
@@ -27,16 +27,9 @@ func (daemon *Daemon) ContainerKill(name string, sig uint64) error {
|
||||
|
||||
// If no signal is passed, or SIGKILL, perform regular Kill (SIGKILL + wait())
|
||||
if sig == 0 || syscall.Signal(sig) == syscall.SIGKILL {
|
||||
if err := daemon.Kill(container); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
// Otherwise, just send the requested signal
|
||||
if err := daemon.killWithSignal(container, int(sig)); err != nil {
|
||||
return err
|
||||
}
|
||||
return daemon.Kill(container)
|
||||
}
|
||||
return nil
|
||||
return daemon.killWithSignal(container, int(sig))
|
||||
}
|
||||
|
||||
// killWithSignal sends the container the given signal. This wrapper for the
|
||||
|
||||
Reference in New Issue
Block a user