From 36454187dbd9d543c4ff2f4c9c41e513fcae54ab Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 3 Jan 2018 10:09:35 -0800 Subject: [PATCH] net: report connect error as coming from "connect" We retrieve an error using getsockopt with SO_ERROR. We were reporting the error as coming from "getsockopt", but really it is coming from "connect". It is not getsockopt that failed. Fixes #19302 Change-Id: I510ab76e4b04c70cd9dfdfc46d9a410bf653d017 Reviewed-on: https://go-review.googlesource.com/85997 Run-TryBot: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/net/fd_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/fd_unix.go b/src/net/fd_unix.go index 87486578af..dd3c1ed882 100644 --- a/src/net/fd_unix.go +++ b/src/net/fd_unix.go @@ -173,7 +173,7 @@ func (fd *netFD) connect(ctx context.Context, la, ra syscall.Sockaddr) (rsa sysc return rsa, nil } default: - return nil, os.NewSyscallError("getsockopt", err) + return nil, os.NewSyscallError("connect", err) } runtime.KeepAlive(fd) } -- 2.48.1