mirror of
https://github.com/golang/go
synced 2024-11-20 04:14:49 -07:00
net: add missing locking in windows Shutdown
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6811069
This commit is contained in:
parent
0b2353edcb
commit
90d959be78
@ -371,9 +371,10 @@ func (fd *netFD) Close() error {
|
||||
}
|
||||
|
||||
func (fd *netFD) shutdown(how int) error {
|
||||
if fd == nil || fd.sysfd == syscall.InvalidHandle {
|
||||
return syscall.EINVAL
|
||||
if err := fd.incref(false); err != nil {
|
||||
return err
|
||||
}
|
||||
defer fd.decref()
|
||||
err := syscall.Shutdown(fd.sysfd, how)
|
||||
if err != nil {
|
||||
return &OpError{"shutdown", fd.net, fd.laddr, err}
|
||||
|
Loading…
Reference in New Issue
Block a user