]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: apply comment from Mikioh
authorRuss Cox <rsc@golang.org>
Sun, 29 Jul 2012 23:50:23 +0000 (19:50 -0400)
committerRuss Cox <rsc@golang.org>
Sun, 29 Jul 2012 23:50:23 +0000 (19:50 -0400)
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

index 36fba9e06ff877407dc0a4d60c8bc6715c22e565..26eb196af9586d3a084f386f85e7ad40d4589fb4 100644 (file)
@@ -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