mirror of
https://github.com/golang/go
synced 2024-11-25 11:48:04 -07:00
net: fix unintentional error variable shadowing
R=rsc CC=golang-dev https://golang.org/cl/5543065
This commit is contained in:
parent
b24d1cb5ec
commit
a5aa4d3307
@ -20,7 +20,7 @@ var listenerBacklog = maxListenerBacklog()
|
|||||||
func socket(net string, f, p, t int, la, ra syscall.Sockaddr, toAddr func(syscall.Sockaddr) Addr) (fd *netFD, err error) {
|
func socket(net string, f, p, t int, la, ra syscall.Sockaddr, toAddr func(syscall.Sockaddr) Addr) (fd *netFD, err error) {
|
||||||
// See ../syscall/exec.go for description of ForkLock.
|
// See ../syscall/exec.go for description of ForkLock.
|
||||||
syscall.ForkLock.RLock()
|
syscall.ForkLock.RLock()
|
||||||
s, e := syscall.Socket(f, p, t)
|
s, err := syscall.Socket(f, p, t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
syscall.ForkLock.RUnlock()
|
syscall.ForkLock.RUnlock()
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -31,10 +31,10 @@ func socket(net string, f, p, t int, la, ra syscall.Sockaddr, toAddr func(syscal
|
|||||||
setDefaultSockopts(s, f, p)
|
setDefaultSockopts(s, f, p)
|
||||||
|
|
||||||
if la != nil {
|
if la != nil {
|
||||||
e = syscall.Bind(s, la)
|
err = syscall.Bind(s, la)
|
||||||
if e != nil {
|
if err != nil {
|
||||||
closesocket(s)
|
closesocket(s)
|
||||||
return nil, e
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user