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

Delta Between Two Patch Sets: src/pkg/net/unixsock_posix.go

Issue 8318044: code review 8318044: net: fix possible runtime.PollDesc leak when connect or... (Closed)
Left Patch Set: diff -r 3346bb37412c https://code.google.com/p/go Created 10 years, 12 months ago
Right Patch Set: diff -r f2a65f5804ec https://code.google.com/p/go Created 10 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« src/pkg/net/fd_unix.go ('K') | « src/pkg/net/tcpsock_posix.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // +build darwin freebsd linux netbsd openbsd windows 5 // +build darwin freebsd linux netbsd openbsd windows
6 6
7 package net 7 package net
8 8
9 import ( 9 import (
10 "errors" 10 "errors"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 if laddr == nil { 265 if laddr == nil {
266 return nil, &OpError{"listen", net, nil, errMissingAddress} 266 return nil, &OpError{"listen", net, nil, errMissingAddress}
267 } 267 }
268 fd, err := unixSocket(net, laddr, nil, "listen", noDeadline) 268 fd, err := unixSocket(net, laddr, nil, "listen", noDeadline)
269 if err != nil { 269 if err != nil {
270 return nil, err 270 return nil, err
271 } 271 }
272 err = syscall.Listen(fd.sysfd, listenerBacklog) 272 err = syscall.Listen(fd.sysfd, listenerBacklog)
273 if err != nil { 273 if err != nil {
274 » » closesocket(fd.sysfd) 274 » » fd.Close()
275 return nil, &OpError{Op: "listen", Net: net, Addr: laddr, Err: e rr} 275 return nil, &OpError{Op: "listen", Net: net, Addr: laddr, Err: e rr}
276 } 276 }
277 return &UnixListener{fd, laddr.Name}, nil 277 return &UnixListener{fd, laddr.Name}, nil
278 } 278 }
279 279
280 // AcceptUnix accepts the next incoming call and returns the new 280 // AcceptUnix accepts the next incoming call and returns the new
281 // connection and the remote address. 281 // connection and the remote address.
282 func (l *UnixListener) AcceptUnix() (*UnixConn, error) { 282 func (l *UnixListener) AcceptUnix() (*UnixConn, error) {
283 if l == nil || l.fd == nil { 283 if l == nil || l.fd == nil {
284 return nil, syscall.EINVAL 284 return nil, syscall.EINVAL
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 353 }
354 if laddr == nil { 354 if laddr == nil {
355 return nil, &OpError{"listen", net, nil, errMissingAddress} 355 return nil, &OpError{"listen", net, nil, errMissingAddress}
356 } 356 }
357 fd, err := unixSocket(net, laddr, nil, "listen", noDeadline) 357 fd, err := unixSocket(net, laddr, nil, "listen", noDeadline)
358 if err != nil { 358 if err != nil {
359 return nil, err 359 return nil, err
360 } 360 }
361 return newUnixConn(fd), nil 361 return newUnixConn(fd), nil
362 } 362 }
LEFTRIGHT

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