Commit 215777b3 authored by Mikio Hara's avatar Mikio Hara

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
parent d74680ea
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment