mirror of
https://github.com/golang/go
synced 2024-11-13 19:10:22 -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:
parent
472354f81e
commit
94064548c6
@ -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)
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user