daemon/kill.go: simplify if statement
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
87de5fdd59
commit
fa7ec908c4
|
@ -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 no signal is passed, or SIGKILL, perform regular Kill (SIGKILL + wait())
|
||||||
if sig == 0 || syscall.Signal(sig) == syscall.SIGKILL {
|
if sig == 0 || syscall.Signal(sig) == syscall.SIGKILL {
|
||||||
if err := daemon.Kill(container); err != nil {
|
return daemon.Kill(container)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
} else {
|
return daemon.killWithSignal(container, int(sig))
|
||||||
// Otherwise, just send the requested signal
|
|
||||||
if err := daemon.killWithSignal(container, int(sig)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// killWithSignal sends the container the given signal. This wrapper for the
|
// killWithSignal sends the container the given signal. This wrapper for the
|
||||||
|
|
Loading…
Reference in New Issue