mirror of https://github.com/golang/go.git
undo CL 92210044 / 5cb21eee2d35
<enter reason for undo> ««« original CL description net: make use of SO_LINGER_SEC on darwin Fixes #7971. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/92210044 »»» TBR=iant R=golang-codereviews CC=golang-codereviews https://golang.org/cl/96220049
This commit is contained in:
parent
900d49bf17
commit
c91aea6c31
|
|
@ -8,7 +8,6 @@ package net
|
|||
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
|
|
@ -138,9 +137,5 @@ func setLinger(fd *netFD, sec int) error {
|
|||
return err
|
||||
}
|
||||
defer fd.decref()
|
||||
opt := syscall.SO_LINGER
|
||||
if runtime.GOOS == "darwin" {
|
||||
opt = syscall.SO_LINGER_SEC
|
||||
}
|
||||
return os.NewSyscallError("setsockopt", syscall.SetsockoptLinger(fd.sysfd, syscall.SOL_SOCKET, opt, &l))
|
||||
return os.NewSyscallError("setsockopt", syscall.SetsockoptLinger(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_LINGER, &l))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue