Commit ed1cbca8 authored by Michael Hoisie's avatar Michael Hoisie Committed by Russ Cox

net: fix close of Listener

Fixes #1375.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3731048
parent bf453eba
......@@ -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
......
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