Skip to content

Commit

Permalink
daemon/kill.go: simplify if statement
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Morozov <[email protected]>
  • Loading branch information
LK4D4 committed Nov 12, 2015
1 parent 87de5fd commit fa7ec90
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions daemon/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fa7ec90

Please sign in to comment.