From ee6b5e2fd11203118ee0f6c4278e0f366508386c Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Fri, 8 Mar 2024 05:54:06 +0100 Subject: [PATCH] Use the same cfg-gate on Socket::set_reuse_port as their documentation This adds support for compiling on Solaris (once supported in `nix` and `if-addrs`). --- src/address_family.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/address_family.rs b/src/address_family.rs index cd034f6..e1a1638 100644 --- a/src/address_family.rs +++ b/src/address_family.rs @@ -34,8 +34,7 @@ pub trait AddressFamily { socket.set_reuse_address(true)?; socket.set_nonblocking(true)?; - #[cfg(not(windows))] - #[cfg(not(target_os = "illumos"))] + #[cfg(all(unix, not(any(target_os = "solaris", target_os = "illumos"))))] socket.set_reuse_port(true)?; socket.bind(&addr)?;