[exec] Replace syscall with /x/sys/unix

This replaces the syscall usage with sys/unix in the execution code

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-04-10 11:56:33 -07:00
parent 4f33aa2b5c
commit 4f7d521510
6 changed files with 43 additions and 37 deletions

View File

@@ -15,6 +15,7 @@ import (
google_protobuf "github.com/golang/protobuf/ptypes/empty"
"github.com/pkg/errors"
"golang.org/x/net/context"
"golang.org/x/sys/unix"
)
var empty = &google_protobuf.Empty{}
@@ -180,7 +181,7 @@ func (s *Service) State(ctx context.Context, r *shimapi.StateRequest) (*shimapi.
defer s.mu.Unlock()
for _, p := range s.processes {
status := container.Status_RUNNING
if err := syscall.Kill(p.Pid(), 0); err != nil {
if err := unix.Kill(p.Pid(), 0); err != nil {
if err != syscall.ESRCH {
return nil, err
}
@@ -210,7 +211,7 @@ func (s *Service) Resume(ctx context.Context, r *shimapi.ResumeRequest) (*google
func (s *Service) Exit(ctx context.Context, r *shimapi.ExitRequest) (*google_protobuf.Empty, error) {
// signal ourself to exit
if err := syscall.Kill(os.Getpid(), syscall.SIGTERM); err != nil {
if err := unix.Kill(os.Getpid(), syscall.SIGTERM); err != nil {
return nil, err
}
return empty, nil