Message ID | mcr7gaorh2g.fsf@iant-glaptop.roam.corp.google.com |
---|---|
State | New |
Headers | show |
diff -r 0d4f83bb938b src/pkg/net/fd_unix.go --- a/src/pkg/net/fd_unix.go Sat Dec 28 20:33:05 2013 +1100 +++ b/src/pkg/net/fd_unix.go Sat Dec 28 09:37:28 2013 -0800 @@ -80,6 +80,16 @@ if err == nil || err == syscall.EISCONN { break } + + // On Solaris we can see EINVAL if the socket has + // already been accepted and closed by the server. + // Treat this as a successful connection--writes to + // the socket will see EOF. For details and a test + // case in C see http://golang.org/issue/6828. + if runtime.GOOS == "solaris" && err == syscall.EINVAL { + break + } + if err != syscall.EINPROGRESS && err != syscall.EALREADY && err != syscall.EINTR { return err }