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:
Mikio Hara 2012-02-22 19:08:19 +09:00
parent d74680ea1c
commit 215777b332
2 changed files with 8 additions and 9 deletions

View file

@ -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) { 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 var la, ra syscall.Sockaddr
family := favoriteAddrFamily(net, laddr, raddr, mode) family := favoriteAddrFamily(net, laddr, raddr, mode)
if laddr != nil { if laddr != nil {
if la, oserr = laddr.sockaddr(family); oserr != nil { if la, err = laddr.sockaddr(family); err != nil {
goto Error goto Error
} }
} }
if raddr != nil { if raddr != nil {
if ra, oserr = raddr.sockaddr(family); oserr != nil { if ra, err = raddr.sockaddr(family); err != nil {
goto Error goto Error
} }
} }
fd, oserr = socket(net, family, sotype, proto, la, ra, toAddr) fd, err = socket(net, family, sotype, proto, la, ra, toAddr)
if oserr != nil { if err != nil {
goto Error goto Error
} }
return fd, nil return fd, nil
@ -129,7 +128,7 @@ Error:
if mode == "listen" { if mode == "listen" {
addr = laddr 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) { func ipToSockaddr(family int, ip IP, port int) (syscall.Sockaddr, error) {

View file

@ -59,8 +59,8 @@ func unixSocket(net string, laddr, raddr *UnixAddr, mode string) (fd *netFD, err
f = sockaddrToUnixpacket f = sockaddrToUnixpacket
} }
fd, oserr := socket(net, syscall.AF_UNIX, sotype, 0, la, ra, f) fd, err = socket(net, syscall.AF_UNIX, sotype, 0, la, ra, f)
if oserr != nil { if err != nil {
goto Error goto Error
} }
return fd, nil return fd, nil
@ -70,7 +70,7 @@ Error:
if mode == "listen" { if mode == "listen" {
addr = laddr 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 { func sockaddrToUnix(sa syscall.Sockaddr) Addr {