Skip to content

Commit

Permalink
Moving the rest of runc to x/sys/unix
Browse files Browse the repository at this point in the history
Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
  • Loading branch information
clnperez committed May 22, 2017
1 parent 11fc4e9 commit 9e7fc57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import (
"fmt"
"strconv"
"strings"
"syscall"

"github.com/opencontainers/runc/libcontainer"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/urfave/cli"

"golang.org/x/sys/unix"
)

var checkpointCommand = cli.Command{
Expand Down Expand Up @@ -113,7 +114,7 @@ func setManageCgroupsMode(context *cli.Context, options *libcontainer.CriuOpts)
}

var namespaceMapping = map[specs.LinuxNamespaceType]int{
specs.NetworkNamespace: syscall.CLONE_NEWNET,
specs.NetworkNamespace: unix.CLONE_NEWNET,
}

func setEmptyNsMask(context *cli.Context, options *libcontainer.CriuOpts) error {
Expand Down
4 changes: 3 additions & 1 deletion delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import (

"github.com/opencontainers/runc/libcontainer"
"github.com/urfave/cli"

"golang.org/x/sys/unix"
)

func killContainer(container libcontainer.Container) error {
_ = container.Signal(syscall.SIGKILL, false)
_ = container.Signal(unix.SIGKILL, false)
for i := 0; i < 100; i++ {
time.Sleep(100 * time.Millisecond)
if err := container.Signal(syscall.Signal(0), false); err != nil {
Expand Down
5 changes: 3 additions & 2 deletions utils_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"os"
"path/filepath"
"strconv"
"syscall"

"github.com/Sirupsen/logrus"
"github.com/coreos/go-systemd/activation"
Expand All @@ -20,6 +19,8 @@ import (
"github.com/opencontainers/runc/libcontainer/utils"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/urfave/cli"

"golang.org/x/sys/unix"
)

var errEmptyID = errors.New("container id cannot be empty")
Expand Down Expand Up @@ -316,7 +317,7 @@ func (r *runner) destroy() {
}

func (r *runner) terminate(p *libcontainer.Process) {
_ = p.Signal(syscall.SIGKILL)
_ = p.Signal(unix.SIGKILL)
_, _ = p.Wait()
}

Expand Down

0 comments on commit 9e7fc57

Please sign in to comment.