Commit d0228b03 authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

net: drop special case for macOS 10.7 and earlier

Updates #23122

Change-Id: Ia2c869a140c8ee01b5861897e4706389950d387e
Reviewed-on: https://go-review.googlesource.com/116156
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent d6c3b0a5
...@@ -16,9 +16,7 @@ func setKeepAlivePeriod(fd *netFD, d time.Duration) error { ...@@ -16,9 +16,7 @@ func setKeepAlivePeriod(fd *netFD, d time.Duration) error {
// The kernel expects seconds so round to next highest second. // The kernel expects seconds so round to next highest second.
d += (time.Second - time.Nanosecond) d += (time.Second - time.Nanosecond)
secs := int(d.Seconds()) secs := int(d.Seconds())
switch err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, sysTCP_KEEPINTVL, secs); err { if err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, sysTCP_KEEPINTVL, secs); err != nil {
case nil, syscall.ENOPROTOOPT: // OS X 10.7 and earlier don't support this option
default:
return wrapSyscallError("setsockopt", err) return wrapSyscallError("setsockopt", err)
} }
err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, syscall.TCP_KEEPALIVE, secs) err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, syscall.TCP_KEEPALIVE, secs)
......
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