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

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

Issue 5558056: code review 5558056: net: fix linux build (Closed)
Patch Set: diff -r cc1fb54d8263 https://go.googlecode.com/hg/ Created 12 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/net/unicast_test.go
===================================================================
--- a/src/pkg/net/unicast_test.go
+++ b/src/pkg/net/unicast_test.go
@@ -5,6 +5,7 @@
package net
import (
+ "io"
"runtime"
"testing"
)
@@ -33,24 +34,27 @@
if tt.ipv6 && !supportsIPv6 {
continue
}
- var fd *netFD
+ var (
+ fd *netFD
+ closer io.Closer
+ )
if !tt.packet {
if tt.laddr == "previous" {
tt.laddr = prevladdr
}
- c, err := Listen(tt.net, tt.laddr)
+ l, err := Listen(tt.net, tt.laddr)
if err != nil {
t.Fatalf("Listen failed: %v", err)
}
- prevladdr = c.Addr().String()
- defer c.Close()
- fd = c.(*TCPListener).fd
+ prevladdr = l.Addr().String()
+ closer = l
+ fd = l.(*TCPListener).fd
} else {
c, err := ListenPacket(tt.net, tt.laddr)
if err != nil {
t.Fatalf("ListenPacket failed: %v", err)
}
- defer c.Close()
+ closer = c
fd = c.(*UDPConn).fd
}
if !tt.ipv6 {
@@ -58,6 +62,7 @@
} else {
testIPv6UnicastSocketOptions(t, fd)
}
+ closer.Close()
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

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