Skip to content

Commit

Permalink
net: report connect error as coming from "connect"
Browse files Browse the repository at this point in the history
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 <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
  • Loading branch information
ianlancetaylor committed Jan 3, 2018
1 parent ce94c0a commit 3645418
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net/fd_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 3645418

Please sign in to comment.