Skip to content

Commit d0228b0

Browse files
committed
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 <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent d6c3b0a commit d0228b0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/net/tcpsockopt_darwin.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ func setKeepAlivePeriod(fd *netFD, d time.Duration) error {
1616
// The kernel expects seconds so round to next highest second.
1717
d += (time.Second - time.Nanosecond)
1818
secs := int(d.Seconds())
19-
switch err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, sysTCP_KEEPINTVL, secs); err {
20-
case nil, syscall.ENOPROTOOPT: // OS X 10.7 and earlier don't support this option
21-
default:
19+
if err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, sysTCP_KEEPINTVL, secs); err != nil {
2220
return wrapSyscallError("setsockopt", err)
2321
}
2422
err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, syscall.TCP_KEEPALIVE, secs)

0 commit comments

Comments
 (0)