mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
daemon: killWithSignal, killPossiblyDeadProcess: accept syscall.Signal
This helps reducing some type-juggling / conversions further up the stack. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -2,6 +2,7 @@ package daemon // import "github.com/docker/docker/daemon"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
containertypes "github.com/docker/docker/api/types/container"
|
||||
@@ -42,7 +43,7 @@ func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Containe
|
||||
}
|
||||
|
||||
var (
|
||||
stopSignal = ctr.StopSignal()
|
||||
stopSignal = syscall.Signal(ctr.StopSignal())
|
||||
stopTimeout = ctr.StopTimeout()
|
||||
)
|
||||
if options.Signal != "" {
|
||||
@@ -50,7 +51,7 @@ func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Containe
|
||||
if err != nil {
|
||||
return errdefs.InvalidParameter(err)
|
||||
}
|
||||
stopSignal = int(sig)
|
||||
stopSignal = sig
|
||||
}
|
||||
if options.Timeout != nil {
|
||||
stopTimeout = *options.Timeout
|
||||
|
||||
Reference in New Issue
Block a user