replace syscall with golang.org/x/sys/unix

This commit is contained in:
Ian Bishop
2017-10-21 07:38:07 +11:00
committed by Vish (Ishaya) Abrams
parent b7fbf1f529
commit 0e3b74dbe2
37 changed files with 605 additions and 585 deletions

View File

@@ -7,10 +7,10 @@ import (
"os"
"runtime"
"strings"
"syscall"
"testing"
"github.com/vishvananda/netns"
"golang.org/x/sys/unix"
)
type tearDownNetlinkTest func()
@@ -84,11 +84,11 @@ func setUpNetlinkTestWithKModule(t *testing.T, name string) tearDownNetlinkTest
}
func remountSysfs() error {
if err := syscall.Mount("", "/", "none", syscall.MS_SLAVE|syscall.MS_REC, ""); err != nil {
if err := unix.Mount("", "/", "none", unix.MS_SLAVE|unix.MS_REC, ""); err != nil {
return err
}
if err := syscall.Unmount("/sys", syscall.MNT_DETACH); err != nil {
if err := unix.Unmount("/sys", unix.MNT_DETACH); err != nil {
return err
}
return syscall.Mount("", "/sys", "sysfs", 0, "")
return unix.Mount("", "/sys", "sysfs", 0, "")
}