diff options
| author | bors <bors@rust-lang.org> | 2016-10-09 10:07:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-09 10:07:39 -0700 |
| commit | a7bfb1aba9d089a0464c03b3841e889c6ee7c4f1 (patch) | |
| tree | 08892e3aec92436a8a3b4b59110174cd69109db1 /src/libstd | |
| parent | 9d4d0da7af77858f268a66ff144134945c880560 (diff) | |
| parent | 14f9cbdfd596390e039a7af8ca3003662fecc28e (diff) | |
| download | rust-a7bfb1aba9d089a0464c03b3841e889c6ee7c4f1.tar.gz rust-a7bfb1aba9d089a0464c03b3841e889c6ee7c4f1.zip | |
Auto merge of #37055 - kali:master, r=alexcrichton
use MSG_NOSIGNAL on all relevant platforms followup #36824
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sys/common/net.rs | 12 | ||||
| -rw-r--r-- | src/libstd/sys/unix/ext/net.rs | 12 |
2 files changed, 18 insertions, 6 deletions
diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index 74a46fce403..10ad61f4c80 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -42,10 +42,16 @@ use sys::net::netc::IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP; target_os = "solaris", target_os = "haiku")))] use sys::net::netc::IPV6_DROP_MEMBERSHIP; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android", + target_os = "dragonfly", target_os = "freebsd", + target_os = "openbsd", target_os = "netbsd", + target_os = "haiku", target_os = "bitrig"))] use libc::MSG_NOSIGNAL; -#[cfg(not(target_os = "linux"))] -const MSG_NOSIGNAL: c_int = 0x0; // unused dummy value +#[cfg(not(any(target_os = "linux", target_os = "android", + target_os = "dragonfly", target_os = "freebsd", + target_os = "openbsd", target_os = "netbsd", + target_os = "haiku", target_os = "bitrig")))] +const MSG_NOSIGNAL: c_int = 0x0; //////////////////////////////////////////////////////////////////////////////// // sockaddr and misc bindings diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs index 622fd4b85a5..80f53da1cef 100644 --- a/src/libstd/sys/unix/ext/net.rs +++ b/src/libstd/sys/unix/ext/net.rs @@ -28,10 +28,16 @@ use sys::cvt; use sys::net::Socket; use sys_common::{AsInner, FromInner, IntoInner}; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android", + target_os = "dragonfly", target_os = "freebsd", + target_os = "openbsd", target_os = "netbsd", + target_os = "haiku", target_os = "bitrig"))] use libc::MSG_NOSIGNAL; -#[cfg(not(target_os = "linux"))] -const MSG_NOSIGNAL: libc::c_int = 0x0; // unused dummy value +#[cfg(not(any(target_os = "linux", target_os = "android", + target_os = "dragonfly", target_os = "freebsd", + target_os = "openbsd", target_os = "netbsd", + target_os = "haiku", target_os = "bitrig")))] +const MSG_NOSIGNAL: libc::c_int = 0x0; fn sun_path_offset() -> usize { unsafe { |
