1
0
mirror of https://github.com/golang/go synced 2024-11-24 22:47:58 -07:00

net: fix windows build

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5532102
This commit is contained in:
Mikio Hara 2012-01-20 08:33:37 +09:00
parent 743c2d0f48
commit 7f4936a1c5

View File

@ -230,7 +230,7 @@ type netFD struct {
// immutable until Close // immutable until Close
sysfd syscall.Handle sysfd syscall.Handle
family int family int
proto int sotype int
net string net string
laddr Addr laddr Addr
raddr Addr raddr Addr
@ -244,11 +244,11 @@ type netFD struct {
wio sync.Mutex wio sync.Mutex
} }
func allocFD(fd syscall.Handle, family, proto int, net string) (f *netFD) { func allocFD(fd syscall.Handle, family, sotype int, net string) (f *netFD) {
f = &netFD{ f = &netFD{
sysfd: fd, sysfd: fd,
family: family, family: family,
proto: proto, sotype: sotype,
net: net, net: net,
} }
runtime.SetFinalizer(f, (*netFD).Close) runtime.SetFinalizer(f, (*netFD).Close)
@ -506,7 +506,7 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (nfd *netFD, err err
// Get new socket. // Get new socket.
// 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(fd.family, fd.proto, 0) s, e := syscall.Socket(fd.family, fd.sotype, 0)
if e != nil { if e != nil {
syscall.ForkLock.RUnlock() syscall.ForkLock.RUnlock()
return nil, e return nil, e
@ -546,7 +546,7 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (nfd *netFD, err err
lsa, _ := lrsa.Sockaddr() lsa, _ := lrsa.Sockaddr()
rsa, _ := rrsa.Sockaddr() rsa, _ := rrsa.Sockaddr()
nfd = allocFD(s, fd.family, fd.proto, fd.net) nfd = allocFD(s, fd.family, fd.sotype, fd.net)
nfd.setAddr(toAddr(lsa), toAddr(rsa)) nfd.setAddr(toAddr(lsa), toAddr(rsa))
return nfd, nil return nfd, nil
} }