Commit c91aea6c authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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
parent 900d49bf
...@@ -8,7 +8,6 @@ package net ...@@ -8,7 +8,6 @@ package net
import ( import (
"os" "os"
"runtime"
"syscall" "syscall"
) )
...@@ -138,9 +137,5 @@ func setLinger(fd *netFD, sec int) error { ...@@ -138,9 +137,5 @@ func setLinger(fd *netFD, sec int) error {
return err return err
} }
defer fd.decref() defer fd.decref()
opt := syscall.SO_LINGER return os.NewSyscallError("setsockopt", syscall.SetsockoptLinger(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_LINGER, &l))
if runtime.GOOS == "darwin" {
opt = syscall.SO_LINGER_SEC
}
return os.NewSyscallError("setsockopt", syscall.SetsockoptLinger(fd.sysfd, syscall.SOL_SOCKET, opt, &l))
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment