From d0228b03bd77e048504877797e53e3f16b149d8f Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 4 Jun 2018 20:06:30 +0200 Subject: [PATCH] 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 Reviewed-by: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/net/tcpsockopt_darwin.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/net/tcpsockopt_darwin.go b/src/net/tcpsockopt_darwin.go index 7415c763c5..5b738d23e6 100644 --- a/src/net/tcpsockopt_darwin.go +++ b/src/net/tcpsockopt_darwin.go @@ -16,9 +16,7 @@ func setKeepAlivePeriod(fd *netFD, d time.Duration) error { // The kernel expects seconds so round to next highest second. d += (time.Second - time.Nanosecond) secs := int(d.Seconds()) - switch err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, sysTCP_KEEPINTVL, secs); err { - case nil, syscall.ENOPROTOOPT: // OS X 10.7 and earlier don't support this option - default: + if err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, sysTCP_KEEPINTVL, secs); err != nil { return wrapSyscallError("setsockopt", err) } err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, syscall.TCP_KEEPALIVE, secs) -- 2.50.0