Skip to content

Commit ab8814d

Browse files
committed
Auto merge of rust-lang#119569 - matthiaskrgr:rollup-4packja, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#118521 (Enable address sanitizer for MSVC targets using INFERASANLIBS linker flag) - rust-lang#119026 (std::net::bind using -1 for openbsd which in turn sets it to somaxconn.) - rust-lang#119195 (Make named_asm_labels lint not trigger on unicode and trigger on format args) - rust-lang#119204 (macro_rules: Less hacky heuristic for using `tt` metavariable spans) - rust-lang#119362 (Make `derive(Trait)` suggestion more accurate) - rust-lang#119397 (Recover parentheses in range patterns) - rust-lang#119417 (Uplift some miscellaneous coroutine-specific machinery into `check_closure`) - rust-lang#119539 (Fix typos) - rust-lang#119540 (Don't synthesize host effect args inside trait object types) - rust-lang#119555 (Add codegen test for RVO on MaybeUninit) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9221894 + 8f5d5b6 commit ab8814d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

std/src/os/unix/net/listener.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,18 @@ impl UnixListener {
7373
unsafe {
7474
let inner = Socket::new_raw(libc::AF_UNIX, libc::SOCK_STREAM)?;
7575
let (addr, len) = sockaddr_un(path.as_ref())?;
76-
const backlog: libc::c_int =
77-
if cfg!(any(target_os = "linux", target_os = "freebsd")) { -1 } else { 128 };
76+
#[cfg(any(target_os = "windows", target_os = "redox"))]
77+
const backlog: libc::c_int = 128;
78+
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
79+
const backlog: libc::c_int = -1;
80+
#[cfg(not(any(
81+
target_os = "windows",
82+
target_os = "redox",
83+
target_os = "linux",
84+
target_os = "freebsd",
85+
target_os = "openbsd"
86+
)))]
87+
const backlog: libc::c_int = libc::SOMAXCONN;
7888

7989
cvt(libc::bind(inner.as_inner().as_raw_fd(), &addr as *const _ as *const _, len as _))?;
8090
cvt(libc::listen(inner.as_inner().as_raw_fd(), backlog))?;

0 commit comments

Comments
 (0)