Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Unified Diff: src/pkg/net/tcpsock.go

Issue 163052: code review 163052: Fix netFD.Close races demonstrated in Issues 321 and 271. (Closed)
Patch Set: code review 163052: Fix netFD.Close races demonstrated in Issues 321 and 271. Created 15 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/net/sock.go ('k') | src/pkg/net/udpsock.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/net/tcpsock.go
===================================================================
--- a/src/pkg/net/tcpsock.go
+++ b/src/pkg/net/tcpsock.go
@@ -73,7 +73,7 @@
func newTCPConn(fd *netFD) *TCPConn {
c := &TCPConn{fd};
- setsockoptInt(fd.fd, syscall.IPPROTO_TCP, syscall.TCP_NODELAY, 1);
+ setsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_NODELAY, 1);
return c;
}
@@ -234,9 +234,9 @@
if err != nil {
return nil, err
}
- errno := syscall.Listen(fd.fd, listenBacklog());
+ errno := syscall.Listen(fd.sysfd, listenBacklog());
if errno != 0 {
- syscall.Close(fd.fd);
+ syscall.Close(fd.sysfd);
return nil, &OpError{"listen", "tcp", laddr, os.Errno(errno)};
}
l = new(TCPListener);
@@ -247,7 +247,7 @@
// AcceptTCP accepts the next incoming call and returns the new connection
// and the remote address.
func (l *TCPListener) AcceptTCP() (c *TCPConn, err os.Error) {
- if l == nil || l.fd == nil || l.fd.fd < 0 {
+ if l == nil || l.fd == nil || l.fd.sysfd < 0 {
return nil, os.EINVAL
}
fd, err := l.fd.accept(sockaddrToTCP);
« no previous file with comments | « src/pkg/net/sock.go ('k') | src/pkg/net/udpsock.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b