Merge pull request #17 from tklauser/x-sys-unix-setns
pkg/ns: use unix.Setns() instead of open coding it
This commit is contained in:
commit
7cda9af13f
@ -141,7 +141,7 @@ func (ns *netNS) Set() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, _, err := unix.Syscall(unix.SYS_SETNS, ns.Fd(), uintptr(unix.CLONE_NEWNET), 0); err != 0 {
|
||||
if err := unix.Setns(int(ns.Fd()), unix.CLONE_NEWNET); err != nil {
|
||||
return fmt.Errorf("Error switching to ns %v: %v", ns.file.Name(), err)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user