From c9856e7d2244670a9c8cd8a4e8aa361b7667575d Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Mon, 19 Nov 2012 06:53:58 +1100 Subject: [PATCH] net: fix data race on fd.sysfd Fixes #4369. Remove the check for fd.sysfd < 0, the first line of fd.accept() tests if the fd is open correctly and will handle the fd being closed during accept. R=dvyukov, bradfitz CC=golang-dev https://golang.org/cl/6843076 --- src/pkg/net/tcpsock_posix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/net/tcpsock_posix.go b/src/pkg/net/tcpsock_posix.go index 7b827f1e97..e5b3a09f75 100644 --- a/src/pkg/net/tcpsock_posix.go +++ b/src/pkg/net/tcpsock_posix.go @@ -231,7 +231,7 @@ type TCPListener struct { // AcceptTCP accepts the next incoming call and returns the new connection // and the remote address. func (l *TCPListener) AcceptTCP() (c *TCPConn, err error) { - if l == nil || l.fd == nil || l.fd.sysfd < 0 { + if l == nil || l.fd == nil { return nil, syscall.EINVAL } fd, err := l.fd.accept(sockaddrToTCP) -- 2.48.1