summaryrefslogtreecommitdiff
path: root/src/net/fd_plan9.go
diff options
context:
space:
mode:
authorMikio Hara <mikioh.mikioh@gmail.com>2015-04-16 16:24:45 +0900
committerMikio Hara <mikioh.mikioh@gmail.com>2015-04-17 00:09:13 +0000
commit3185cfbfbbf7ab7067ea96a2198dbbd510a78515 (patch)
tree6efdd005dc2183fce411e79645fccc18233815ae /src/net/fd_plan9.go
parent28388c4eb102f3218bbbdcca4699de6b078bdde6 (diff)
downloadgo-git-3185cfbfbbf7ab7067ea96a2198dbbd510a78515.tar.gz
net: rename netFD.proto to netFD.net on Plan 9
In followup changes, we'll move OpError around from the netFD layer to the Conn layer for fixing #4856. Before doing that, this change makes netFD of Plan 9 match netFD for POSIX platforms to avoid conflict. Change-Id: Iea7632716d48722a1758e52effefec964a3a9442 Reviewed-on: https://go-review.googlesource.com/8990 Reviewed-by: David du Colombier <0intro@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/net/fd_plan9.go')
-rw-r--r--src/net/fd_plan9.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net/fd_plan9.go b/src/net/fd_plan9.go
index 38355e2458..29ec801278 100644
--- a/src/net/fd_plan9.go
+++ b/src/net/fd_plan9.go
@@ -17,7 +17,7 @@ type netFD struct {
fdmu fdMutex
// immutable until Close
- proto string
+ net string
n string
dir string
ctl, data *os.File
@@ -38,8 +38,8 @@ func dial(net string, ra Addr, dialer func(time.Time) (Conn, error), deadline ti
return dialChannel(net, ra, dialer, deadline)
}
-func newFD(proto, name string, ctl, data *os.File, laddr, raddr Addr) (*netFD, error) {
- return &netFD{proto: proto, n: name, dir: netdir + "/" + proto + "/" + name, ctl: ctl, data: data, laddr: laddr, raddr: raddr}, nil
+func newFD(net, name string, ctl, data *os.File, laddr, raddr Addr) (*netFD, error) {
+ return &netFD{net: net, n: name, dir: netdir + "/" + net + "/" + name, ctl: ctl, data: data, laddr: laddr, raddr: raddr}, nil
}
func (fd *netFD) init() error {
@@ -55,7 +55,7 @@ func (fd *netFD) name() string {
if fd.raddr != nil {
rs = fd.raddr.String()
}
- return fd.proto + ":" + ls + "->" + rs
+ return fd.net + ":" + ls + "->" + rs
}
func (fd *netFD) ok() bool { return fd != nil && fd.ctl != nil }
@@ -132,7 +132,7 @@ func (fd *netFD) Read(b []byte) (n int, err error) {
}
defer fd.readUnlock()
n, err = fd.data.Read(b)
- if fd.proto == "udp" && err == io.EOF {
+ if fd.net == "udp" && err == io.EOF {
n = 0
err = nil
}