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:
Brad Fitzpatrick 2014-05-12 08:48:19 -07:00
parent 900d49bf17
commit c91aea6c31
1 changed files with 1 additions and 6 deletions

View File

@ -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))
}