summaryrefslogtreecommitdiffstats
path: root/libgo/go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-26 04:25:56 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-26 04:25:56 +0000
commit604e7f91869fea4c0ada322f8f6a219b22a50a54 (patch)
tree10ebba1f59e1c1d7beab57c399d2bf0e218e05a4 /libgo/go
parent8aa82d33f4466851131dc4df40952c0e287d0939 (diff)
downloadppe42-gcc-604e7f91869fea4c0ada322f8f6a219b22a50a54.tar.gz
ppe42-gcc-604e7f91869fea4c0ada322f8f6a219b22a50a54.zip
mksysinfo, net: Always define syscall.SO_REUSEPORT.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186857 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go')
-rw-r--r--libgo/go/net/sockopt_bsd.go8
1 files changed, 5 insertions, 3 deletions
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
}
OpenPOWER on IntegriCloud