mirror of
https://github.com/golang/go
synced 2024-11-22 14:04:48 -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()
|
||||
|
||||
// Get new socket.
|
||||
// See ../syscall/exec_unix.go for description of ForkLock.
|
||||
syscall.ForkLock.RLock()
|
||||
s, err := syscall.Socket(fd.family, fd.sotype, 0)
|
||||
s, err := sysSocket(fd.family, fd.sotype, 0)
|
||||
if err != nil {
|
||||
syscall.ForkLock.RUnlock()
|
||||
return nil, &OpError{"socket", fd.net, fd.laddr, err}
|
||||
}
|
||||
syscall.CloseOnExec(s)
|
||||
syscall.ForkLock.RUnlock()
|
||||
|
||||
// Associate our new socket with IOCP.
|
||||
onceStartServer.Do(startServer)
|
||||
|
@ -38,7 +38,7 @@ func getAdapterList() (*syscall.IpAdapterInfo, 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 {
|
||||
return nil, os.NewSyscallError("Socket", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user