1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Properly handle 0 being passed as a signal

Docker-DCO-1.1-Signed-off-by: Matt Heon <mheon@redhat.com> (github: mheon)
This commit is contained in:
Matthew Heon 2014-07-24 09:48:20 -04:00
parent 9380e8cbe7
commit be326b0ece

View file

@ -229,10 +229,10 @@ func (srv *Server) ContainerKill(job *engine.Job) engine.Status {
if err != nil {
// The signal is not a number, treat it as a string (either like "KILL" or like "SIGKILL")
sig = uint64(signal.SignalMap[strings.TrimPrefix(job.Args[1], "SIG")])
if sig == 0 {
return job.Errorf("Invalid signal: %s", job.Args[1])
}
}
if sig == 0 {
return job.Errorf("Invalid signal: %s", job.Args[1])
}
}