diff options
Diffstat (limited to 'libgo/go/net/fd_unix.go')
-rw-r--r-- | libgo/go/net/fd_unix.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libgo/go/net/fd_unix.go b/libgo/go/net/fd_unix.go index 4911ab0abe3..a89303e37e9 100644 --- a/libgo/go/net/fd_unix.go +++ b/libgo/go/net/fd_unix.go @@ -80,6 +80,16 @@ func (fd *netFD) connect(la, ra syscall.Sockaddr) error { 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 } |