1
0
mirror of https://github.com/golang/go synced 2024-11-22 19:05:01 -07:00

net: use windows sysSocket everywhere

R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7273046
This commit is contained in:
Alex Brainman 2013-02-04 16:03:41 +11:00
parent 472354f81e
commit 94064548c6
2 changed files with 2 additions and 7 deletions

View File

@ -619,15 +619,10 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (*netFD, error) {
defer fd.decref() defer fd.decref()
// Get new socket. // Get new socket.
// See ../syscall/exec_unix.go for description of ForkLock. s, err := sysSocket(fd.family, fd.sotype, 0)
syscall.ForkLock.RLock()
s, err := syscall.Socket(fd.family, fd.sotype, 0)
if err != nil { if err != nil {
syscall.ForkLock.RUnlock()
return nil, &OpError{"socket", fd.net, fd.laddr, err} return nil, &OpError{"socket", fd.net, fd.laddr, err}
} }
syscall.CloseOnExec(s)
syscall.ForkLock.RUnlock()
// Associate our new socket with IOCP. // Associate our new socket with IOCP.
onceStartServer.Do(startServer) onceStartServer.Do(startServer)

View File

@ -38,7 +38,7 @@ func getAdapterList() (*syscall.IpAdapterInfo, error) {
} }
func getInterfaceList() ([]syscall.InterfaceInfo, error) { func getInterfaceList() ([]syscall.InterfaceInfo, error) {
s, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_DGRAM, syscall.IPPROTO_UDP) s, err := sysSocket(syscall.AF_INET, syscall.SOCK_DGRAM, syscall.IPPROTO_UDP)
if err != nil { if err != nil {
return nil, os.NewSyscallError("Socket", err) return nil, os.NewSyscallError("Socket", err)
} }