From: Ian Lance Taylor Date: Sat, 9 Mar 2013 05:18:06 +0000 (-0800) Subject: net: if accept4 returns EINVAL fall back to accept X-Git-Tag: go1.1rc2~623 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=30b89a84acc86fbb6c69b053eb00ce155084d164;p=gostls13.git net: if accept4 returns EINVAL fall back to accept R=golang-dev, andybalholm, mikioh.mikioh CC=golang-dev https://golang.org/cl/7485045 --- diff --git a/src/pkg/net/sock_cloexec.go b/src/pkg/net/sock_cloexec.go index 12d0f34887..3f22cd8f57 100644 --- a/src/pkg/net/sock_cloexec.go +++ b/src/pkg/net/sock_cloexec.go @@ -44,8 +44,8 @@ func sysSocket(f, t, p int) (int, error) { func accept(fd int) (int, syscall.Sockaddr, error) { nfd, sa, err := syscall.Accept4(fd, syscall.SOCK_NONBLOCK|syscall.SOCK_CLOEXEC) // The accept4 system call was introduced in Linux 2.6.28. If - // we get an ENOSYS error, fall back to using accept. - if err == nil || err != syscall.ENOSYS { + // we get an ENOSYS or EINVAL error, fall back to using accept. + if err == nil || (err != syscall.ENOSYS && err != syscall.EINVAL) { return nfd, sa, err }