Skip to content

Commit a7bfb1a

Browse files
authored
Auto merge of #37055 - kali:master, r=alexcrichton
use MSG_NOSIGNAL on all relevant platforms followup #36824
2 parents 9d4d0da + 14f9cbd commit a7bfb1a

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

src/liblibc

Submodule liblibc updated 44 files

src/libstd/sys/common/net.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,16 @@ use sys::net::netc::IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP;
4242
target_os = "solaris", target_os = "haiku")))]
4343
use sys::net::netc::IPV6_DROP_MEMBERSHIP;
4444

45-
#[cfg(target_os = "linux")]
45+
#[cfg(any(target_os = "linux", target_os = "android",
46+
target_os = "dragonfly", target_os = "freebsd",
47+
target_os = "openbsd", target_os = "netbsd",
48+
target_os = "haiku", target_os = "bitrig"))]
4649
use libc::MSG_NOSIGNAL;
47-
#[cfg(not(target_os = "linux"))]
48-
const MSG_NOSIGNAL: c_int = 0x0; // unused dummy value
50+
#[cfg(not(any(target_os = "linux", target_os = "android",
51+
target_os = "dragonfly", target_os = "freebsd",
52+
target_os = "openbsd", target_os = "netbsd",
53+
target_os = "haiku", target_os = "bitrig")))]
54+
const MSG_NOSIGNAL: c_int = 0x0;
4955

5056
////////////////////////////////////////////////////////////////////////////////
5157
// sockaddr and misc bindings

src/libstd/sys/unix/ext/net.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ use sys::cvt;
2828
use sys::net::Socket;
2929
use sys_common::{AsInner, FromInner, IntoInner};
3030

31-
#[cfg(target_os = "linux")]
31+
#[cfg(any(target_os = "linux", target_os = "android",
32+
target_os = "dragonfly", target_os = "freebsd",
33+
target_os = "openbsd", target_os = "netbsd",
34+
target_os = "haiku", target_os = "bitrig"))]
3235
use libc::MSG_NOSIGNAL;
33-
#[cfg(not(target_os = "linux"))]
34-
const MSG_NOSIGNAL: libc::c_int = 0x0; // unused dummy value
36+
#[cfg(not(any(target_os = "linux", target_os = "android",
37+
target_os = "dragonfly", target_os = "freebsd",
38+
target_os = "openbsd", target_os = "netbsd",
39+
target_os = "haiku", target_os = "bitrig")))]
40+
const MSG_NOSIGNAL: libc::c_int = 0x0;
3541

3642
fn sun_path_offset() -> usize {
3743
unsafe {

0 commit comments

Comments
 (0)