Commit ebe5f203 authored by Mikio Hara's avatar Mikio Hara

net: don't export netFD closeRead and closeWrite methods

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/83910043
parent 43b3e6e0
...@@ -150,14 +150,14 @@ func (fd *netFD) Write(b []byte) (n int, err error) { ...@@ -150,14 +150,14 @@ func (fd *netFD) Write(b []byte) (n int, err error) {
return fd.data.Write(b) return fd.data.Write(b)
} }
func (fd *netFD) CloseRead() error { func (fd *netFD) closeRead() error {
if !fd.ok() { if !fd.ok() {
return syscall.EINVAL return syscall.EINVAL
} }
return syscall.EPLAN9 return syscall.EPLAN9
} }
func (fd *netFD) CloseWrite() error { func (fd *netFD) closeWrite() error {
if !fd.ok() { if !fd.ok() {
return syscall.EINVAL return syscall.EINVAL
} }
......
...@@ -208,11 +208,11 @@ func (fd *netFD) shutdown(how int) error { ...@@ -208,11 +208,11 @@ func (fd *netFD) shutdown(how int) error {
return nil return nil
} }
func (fd *netFD) CloseRead() error { func (fd *netFD) closeRead() error {
return fd.shutdown(syscall.SHUT_RD) return fd.shutdown(syscall.SHUT_RD)
} }
func (fd *netFD) CloseWrite() error { func (fd *netFD) closeWrite() error {
return fd.shutdown(syscall.SHUT_WR) return fd.shutdown(syscall.SHUT_WR)
} }
......
...@@ -431,11 +431,11 @@ func (fd *netFD) shutdown(how int) error { ...@@ -431,11 +431,11 @@ func (fd *netFD) shutdown(how int) error {
return nil return nil
} }
func (fd *netFD) CloseRead() error { func (fd *netFD) closeRead() error {
return fd.shutdown(syscall.SHUT_RD) return fd.shutdown(syscall.SHUT_RD)
} }
func (fd *netFD) CloseWrite() error { func (fd *netFD) closeWrite() error {
return fd.shutdown(syscall.SHUT_WR) return fd.shutdown(syscall.SHUT_WR)
} }
......
...@@ -32,7 +32,7 @@ func (c *TCPConn) CloseRead() error { ...@@ -32,7 +32,7 @@ func (c *TCPConn) CloseRead() error {
if !c.ok() { if !c.ok() {
return syscall.EINVAL return syscall.EINVAL
} }
return c.fd.CloseRead() return c.fd.closeRead()
} }
// CloseWrite shuts down the writing side of the TCP connection. // CloseWrite shuts down the writing side of the TCP connection.
...@@ -41,7 +41,7 @@ func (c *TCPConn) CloseWrite() error { ...@@ -41,7 +41,7 @@ func (c *TCPConn) CloseWrite() error {
if !c.ok() { if !c.ok() {
return syscall.EINVAL return syscall.EINVAL
} }
return c.fd.CloseWrite() return c.fd.closeWrite()
} }
// SetLinger sets the behavior of Close() on a connection which still // SetLinger sets the behavior of Close() on a connection which still
......
...@@ -78,7 +78,7 @@ func (c *TCPConn) CloseRead() error { ...@@ -78,7 +78,7 @@ func (c *TCPConn) CloseRead() error {
if !c.ok() { if !c.ok() {
return syscall.EINVAL return syscall.EINVAL
} }
return c.fd.CloseRead() return c.fd.closeRead()
} }
// CloseWrite shuts down the writing side of the TCP connection. // CloseWrite shuts down the writing side of the TCP connection.
...@@ -87,7 +87,7 @@ func (c *TCPConn) CloseWrite() error { ...@@ -87,7 +87,7 @@ func (c *TCPConn) CloseWrite() error {
if !c.ok() { if !c.ok() {
return syscall.EINVAL return syscall.EINVAL
} }
return c.fd.CloseWrite() return c.fd.closeWrite()
} }
// SetLinger sets the behavior of Close() on a connection which still // SetLinger sets the behavior of Close() on a connection which still
......
...@@ -222,7 +222,7 @@ func (c *UnixConn) CloseRead() error { ...@@ -222,7 +222,7 @@ func (c *UnixConn) CloseRead() error {
if !c.ok() { if !c.ok() {
return syscall.EINVAL return syscall.EINVAL
} }
return c.fd.CloseRead() return c.fd.closeRead()
} }
// CloseWrite shuts down the writing side of the Unix domain connection. // CloseWrite shuts down the writing side of the Unix domain connection.
...@@ -231,7 +231,7 @@ func (c *UnixConn) CloseWrite() error { ...@@ -231,7 +231,7 @@ func (c *UnixConn) CloseWrite() error {
if !c.ok() { if !c.ok() {
return syscall.EINVAL return syscall.EINVAL
} }
return c.fd.CloseWrite() return c.fd.closeWrite()
} }
// DialUnix connects to the remote address raddr on the network net, // DialUnix connects to the remote address raddr on the network net,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment