Skip to content

Commit

Permalink
Use the same cfg-gate on Socket::set_reuse_port as their documentation
Browse files Browse the repository at this point in the history
This adds support for compiling on Solaris (once supported in `nix` and `if-addrs`).
  • Loading branch information
madsmtm committed Mar 8, 2024
1 parent c43829a commit ee6b5e2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/address_family.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down

0 comments on commit ee6b5e2

Please sign in to comment.