FAQ
Reviewers: dvyukov, brad_danga_com,

Message:
Hello dvyukov@google.com, bradfitz@gmail.com (cc:
golang-dev@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/go


Description:
net: fix data race on fd.sysfd

Fixes issue 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.

Please review this at http://codereview.appspot.com/6843076/

Affected files:
M src/pkg/net/tcpsock_posix.go


Index: src/pkg/net/tcpsock_posix.go
===================================================================
--- a/src/pkg/net/tcpsock_posix.go
+++ b/src/pkg/net/tcpsock_posix.go
@@ -231,7 +231,7 @@
// 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)

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedNov 18, '12 at 10:33a
activeNov 18, '12 at 7:54p
posts4
users3
websitegolang.org

3 users in discussion

Dave: 2 posts Dvyukov: 1 post Bradfitz: 1 post

People

Translate

site design / logo © 2022 Grokbase