mirror of
https://github.com/golang/go
synced 2024-11-25 00:07:56 -07:00
net: replace error variable name oserr with err
This CL replaces the last two in source tree. R=golang-dev, r CC=golang-dev https://golang.org/cl/5685080
This commit is contained in:
parent
d74680ea1c
commit
215777b332
@ -105,21 +105,20 @@ type sockaddr interface {
|
||||
}
|
||||
|
||||
func internetSocket(net string, laddr, raddr sockaddr, sotype, proto int, mode string, toAddr func(syscall.Sockaddr) Addr) (fd *netFD, err error) {
|
||||
var oserr error
|
||||
var la, ra syscall.Sockaddr
|
||||
family := favoriteAddrFamily(net, laddr, raddr, mode)
|
||||
if laddr != nil {
|
||||
if la, oserr = laddr.sockaddr(family); oserr != nil {
|
||||
if la, err = laddr.sockaddr(family); err != nil {
|
||||
goto Error
|
||||
}
|
||||
}
|
||||
if raddr != nil {
|
||||
if ra, oserr = raddr.sockaddr(family); oserr != nil {
|
||||
if ra, err = raddr.sockaddr(family); err != nil {
|
||||
goto Error
|
||||
}
|
||||
}
|
||||
fd, oserr = socket(net, family, sotype, proto, la, ra, toAddr)
|
||||
if oserr != nil {
|
||||
fd, err = socket(net, family, sotype, proto, la, ra, toAddr)
|
||||
if err != nil {
|
||||
goto Error
|
||||
}
|
||||
return fd, nil
|
||||
@ -129,7 +128,7 @@ Error:
|
||||
if mode == "listen" {
|
||||
addr = laddr
|
||||
}
|
||||
return nil, &OpError{mode, net, addr, oserr}
|
||||
return nil, &OpError{mode, net, addr, err}
|
||||
}
|
||||
|
||||
func ipToSockaddr(family int, ip IP, port int) (syscall.Sockaddr, error) {
|
||||
|
@ -59,8 +59,8 @@ func unixSocket(net string, laddr, raddr *UnixAddr, mode string) (fd *netFD, err
|
||||
f = sockaddrToUnixpacket
|
||||
}
|
||||
|
||||
fd, oserr := socket(net, syscall.AF_UNIX, sotype, 0, la, ra, f)
|
||||
if oserr != nil {
|
||||
fd, err = socket(net, syscall.AF_UNIX, sotype, 0, la, ra, f)
|
||||
if err != nil {
|
||||
goto Error
|
||||
}
|
||||
return fd, nil
|
||||
@ -70,7 +70,7 @@ Error:
|
||||
if mode == "listen" {
|
||||
addr = laddr
|
||||
}
|
||||
return nil, &OpError{Op: mode, Net: net, Addr: addr, Err: oserr}
|
||||
return nil, &OpError{Op: mode, Net: net, Addr: addr, Err: err}
|
||||
}
|
||||
|
||||
func sockaddrToUnix(sa syscall.Sockaddr) Addr {
|
||||
|
Loading…
Reference in New Issue
Block a user