From 7aa60d998a5f81f58a09e6b1e5703becaf486043 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 29 Jul 2012 19:50:23 -0400 Subject: [PATCH] syscall: apply comment from Mikioh This comment was suggested in CL 6456045 but never got applied. R=mikioh, mikioh.mikioh CC=golang-dev https://golang.org/cl/6447056 --- src/pkg/syscall/syscall_bsd.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/syscall/syscall_bsd.go b/src/pkg/syscall/syscall_bsd.go index 36fba9e06f..26eb196af9 100644 --- a/src/pkg/syscall/syscall_bsd.go +++ b/src/pkg/syscall/syscall_bsd.go @@ -13,6 +13,7 @@ package syscall import ( + "runtime" "unsafe" ) @@ -303,7 +304,7 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) { if err != nil { return } - if len == 0 { + if runtime.GOOS == "darwin" && len == 0 { // Accepted socket has no address. // This is likely due to a bug in xnu kernels, // where instead of ECONNABORTED error socket -- 2.48.1