diff options
Diffstat (limited to 'src/pkg/net/file_plan9.go')
-rw-r--r-- | src/pkg/net/file_plan9.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/net/file_plan9.go b/src/pkg/net/file_plan9.go index f6ee1c29e..068f0881d 100644 --- a/src/pkg/net/file_plan9.go +++ b/src/pkg/net/file_plan9.go @@ -43,7 +43,7 @@ func newFileFD(f *os.File) (net *netFD, err error) { } comp := splitAtBytes(path, "/") n := len(comp) - if n < 3 || comp[0] != "net" { + if n < 3 || comp[0][0:3] != "net" { return nil, syscall.EPLAN9 } @@ -58,7 +58,7 @@ func newFileFD(f *os.File) (net *netFD, err error) { } defer close(fd) - dir := "/net/" + comp[n-2] + dir := netdir + "/" + comp[n-2] ctl = os.NewFile(uintptr(fd), dir+"/"+file) ctl.Seek(0, 0) var buf [16]byte @@ -71,19 +71,19 @@ func newFileFD(f *os.File) (net *netFD, err error) { if len(comp) < 4 { return nil, errors.New("could not find control file for connection") } - dir := "/net/" + comp[1] + "/" + name + dir := netdir + "/" + comp[1] + "/" + name ctl, err = os.OpenFile(dir+"/ctl", os.O_RDWR, 0) if err != nil { return nil, err } defer close(int(ctl.Fd())) } - dir := "/net/" + comp[1] + "/" + name + dir := netdir + "/" + comp[1] + "/" + name laddr, err := readPlan9Addr(comp[1], dir+"/local") if err != nil { return nil, err } - return newFD(comp[1], name, ctl, nil, laddr, nil), nil + return newFD(comp[1], name, ctl, nil, laddr, nil) } func newFileConn(f *os.File) (c Conn, err error) { |