]> Cypherpunks repositories - gostls13.git/commitdiff
net: drop special case for macOS 10.7 and earlier
authorTobias Klauser <tklauser@distanz.ch>
Mon, 4 Jun 2018 18:06:30 +0000 (20:06 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Mon, 4 Jun 2018 18:40:49 +0000 (18:40 +0000)
Updates #23122

Change-Id: Ia2c869a140c8ee01b5861897e4706389950d387e
Reviewed-on: https://go-review.googlesource.com/116156
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/tcpsockopt_darwin.go

index 7415c763c501bb6e0261a6b4584e16d0f9f81f5d..5b738d23e6d7f9fa7eb75a1df6aadba52dc8065d 100644 (file)
@@ -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)