From fa7ec908c493161892ebdd7c51b440367f527805 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Wed, 11 Nov 2015 17:19:39 -0800 Subject: [PATCH] daemon/kill.go: simplify if statement Signed-off-by: Alexander Morozov --- daemon/kill.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/daemon/kill.go b/daemon/kill.go index 8b94fa3a88..6ed3a82fee 100644 --- a/daemon/kill.go +++ b/daemon/kill.go @@ -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