1
0
mirror of https://github.com/golang/go synced 2024-11-22 04:34:39 -07:00

net: fix close of Listener

Fixes #1375.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3731048
This commit is contained in:
Michael Hoisie 2011-01-04 11:55:13 -05:00 committed by Russ Cox
parent bf453eba90
commit ed1cbca81f

View File

@ -567,6 +567,10 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (nfd *netFD, err os.
var s, e int
var sa syscall.Sockaddr
for {
if fd.closing {
syscall.ForkLock.RUnlock()
return nil, os.EINVAL
}
s, sa, e = syscall.Accept(fd.sysfd)
if e != syscall.EAGAIN {
break