From 604e7f91869fea4c0ada322f8f6a219b22a50a54 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 26 Apr 2012 04:25:56 +0000 Subject: mksysinfo, net: Always define syscall.SO_REUSEPORT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186857 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgo/go/net/sockopt_bsd.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libgo/go') diff --git a/libgo/go/net/sockopt_bsd.go b/libgo/go/net/sockopt_bsd.go index fff65f362b1..af88814b4b9 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 } -- cgit v1.2.1