1
0
mirror of https://github.com/golang/go synced 2024-11-12 07:10:22 -07:00

net/ipsock.go: fix error checking bug

Check oserr, not err for non-nil (err is never changed)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1965042
This commit is contained in:
Scott Lawrence 2010-08-22 22:12:56 +10:00 committed by Rob Pike
parent e5518feaf8
commit d125faeed0

View File

@ -68,12 +68,12 @@ func internetSocket(net string, laddr, raddr sockaddr, socktype, proto int, mode
var la, ra syscall.Sockaddr var la, ra syscall.Sockaddr
if laddr != nil { if laddr != nil {
if la, oserr = laddr.sockaddr(family); err != nil { if la, oserr = laddr.sockaddr(family); oserr != nil {
goto Error goto Error
} }
} }
if raddr != nil { if raddr != nil {
if ra, oserr = raddr.sockaddr(family); err != nil { if ra, oserr = raddr.sockaddr(family); oserr != nil {
goto Error goto Error
} }
} }