From 730b7a932e36472428e0c4147b6f794963c87033 Mon Sep 17 00:00:00 2001 From: Kenta Tada Date: Thu, 11 Jun 2020 11:35:51 +0900 Subject: [PATCH] Change the type of PdeathSignal Use x/sys as same as runtime/v1/linux/runtime.go Signed-off-by: Kenta Tada --- pkg/process/init.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/process/init.go b/pkg/process/init.go index e94a39a0d..5cb22460a 100644 --- a/pkg/process/init.go +++ b/pkg/process/init.go @@ -27,7 +27,6 @@ import ( "path/filepath" "strings" "sync" - "syscall" "time" "github.com/containerd/console" @@ -39,6 +38,7 @@ import ( google_protobuf "github.com/gogo/protobuf/types" specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" + "golang.org/x/sys/unix" ) // Init represents an initial process for a container @@ -87,7 +87,7 @@ func NewRunc(root, path, namespace, runtime, criu string, systemd bool) *runc.Ru Command: runtime, Log: filepath.Join(path, "log.json"), LogFormat: runc.JSON, - PdeathSignal: syscall.SIGKILL, + PdeathSignal: unix.SIGKILL, Root: filepath.Join(root, namespace), Criu: criu, SystemdCgroup: systemd, @@ -176,7 +176,7 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) error { } func (p *Init) openStdin(path string) error { - sc, err := fifo.OpenFifo(context.Background(), path, syscall.O_WRONLY|syscall.O_NONBLOCK, 0) + sc, err := fifo.OpenFifo(context.Background(), path, unix.O_WRONLY|unix.O_NONBLOCK, 0) if err != nil { return errors.Wrapf(err, "failed to open stdin fifo %s", path) } @@ -361,7 +361,7 @@ func (p *Init) KillAll(ctx context.Context) error { p.mu.Lock() defer p.mu.Unlock() - err := p.runtime.Kill(ctx, p.id, int(syscall.SIGKILL), &runc.KillOpts{ + err := p.runtime.Kill(ctx, p.id, int(unix.SIGKILL), &runc.KillOpts{ All: true, }) return p.runtimeError(err, "OCI runtime killall failed")