diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-04-26 04:25:56 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-04-26 04:25:56 +0000 |
commit | 181c7267c733f28520cc7230b729e03bc237e578 (patch) | |
tree | 10ebba1f59e1c1d7beab57c399d2bf0e218e05a4 /libgo/go | |
parent | af6204cc29a1a02f41a7a3f5d2b6a6b1dd098075 (diff) | |
download | gcc-181c7267c733f28520cc7230b729e03bc237e578.zip gcc-181c7267c733f28520cc7230b729e03bc237e578.tar.gz gcc-181c7267c733f28520cc7230b729e03bc237e578.tar.bz2 |
mksysinfo, net: Always define syscall.SO_REUSEPORT.
From-SVN: r186857
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/net/sockopt_bsd.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libgo/go/net/sockopt_bsd.go b/libgo/go/net/sockopt_bsd.go index fff65f3..af88814 100644 --- a/libgo/go/net/sockopt_bsd.go +++ b/libgo/go/net/sockopt_bsd.go @@ -53,9 +53,11 @@ func setDefaultMulticastSockopts(s int) error { // This option is supported only in descendants of 4.4BSD, // to make an effective multicast application that requires // quick draw possible. - err = syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEPORT, 1) - if err != nil { - return os.NewSyscallError("setsockopt", err) + if syscall.SO_REUSEPORT != 0 { + err = syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEPORT, 1) + if err != nil { + return os.NewSyscallError("setsockopt", err) + } } return nil } |