master
brl 10 years ago
parent 46d170a38b
commit f23045350f

@ -146,7 +146,7 @@ func nsSocketListener(fd uintptr, proto ProtoType, lAddr string) (net.Listener,
/**
* Connect/Server
**/
func proxyServerConn(pid int, conn *net.Conn, proto ProtoType, rAddr string, log *logging.Logger, ready sync.WaitGroup) (error) {
func proxyServerConn(pid int, conn *net.Conn, proto ProtoType, rAddr string, log *logging.Logger, ready sync.WaitGroup) error {
rConn, err := socketConnect(pid, proto, rAddr)
if err != nil {
log.Error("Socket: %+v.", err)
@ -159,7 +159,7 @@ func proxyServerConn(pid int, conn *net.Conn, proto ProtoType, rAddr string, log
return nil
}
func newProxyServer(pid int, proto ProtoType, dest string, port int, log *logging.Logger, ready sync.WaitGroup) (error) {
func newProxyServer(pid int, proto ProtoType, dest string, port int, log *logging.Logger, ready sync.WaitGroup) error {
if dest == "" {
dest = "127.0.0.1"
}

@ -1,8 +1,6 @@
package ns
import (
)
import ()
const (
SYS_SETNS = 308

@ -1,11 +1,11 @@
package ns
import (
"syscall"
"errors"
"os"
"path"
"strconv"
"syscall"
)
type Namespace struct {
@ -37,7 +37,7 @@ func init() {
}
}
func Set(fd, nsType uintptr) (error) {
func Set(fd, nsType uintptr) error {
_, _, err := syscall.Syscall(SYS_SETNS, uintptr(fd), uintptr(nsType), 0)
if err != 0 {
return errors.New("Unable to set namespace")
@ -81,6 +81,6 @@ func Open(nsPath string) (uintptr, error) {
return fd.Fd(), nil
}
func Close(fd uintptr) (error) {
func Close(fd uintptr) error {
return syscall.Close(int(fd))
}

Loading…
Cancel
Save