]> Cypherpunks repositories - gostls13.git/commit
net: move bind back to sock.go
authorAlexey Borzenkov <snaury@gmail.com>
Tue, 29 Mar 2011 18:23:42 +0000 (14:23 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 29 Mar 2011 18:23:42 +0000 (14:23 -0400)
commit0793176451afc562abf070d9fb4819702744fe46
treed37e01557efa2f684d4619db0c6d3e39987204b9
parent85c79ef7cb0cdab34fef9b2bbf8d034eb9883b8e
net: move bind back to sock.go

It was left in netFD.connect() by an oversight (as the name
implies, bind has no business being in connect). As a result
of this change and by only calling netFD.connect() when ra
isn't nil it becomes simpler with less code duplication.

Additionally, if netFD.connect() fails, set sysfd to -1 to
avoid finalizers (e.g. on windows) calling shutdown on a
closed and possibly reopened socket that just happened to
share the same descriptor.

R=golang-dev, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4328043
src/pkg/net/fd.go
src/pkg/net/fd_windows.go
src/pkg/net/sock.go