about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-07-27 18:58:04 -0700
committerGitHub <noreply@github.com>2016-07-27 18:58:04 -0700
commitf5d79521ae1bd53d90e820e9f8c78494fb3a102d (patch)
tree94f50218af4274996f77429f4386b38367962aaf /src/libstd/sys
parentf2e59cc6aa3bf901a4aefa8ad4954edddf3da29f (diff)
parent15cd5a18a656252e32e7320fde3072be7b59db18 (diff)
downloadrust-f5d79521ae1bd53d90e820e9f8c78494fb3a102d.tar.gz
rust-f5d79521ae1bd53d90e820e9f8c78494fb3a102d.zip
Auto merge of #34946 - alexcrichton:fix-cfg, r=brson
std: Fix usage of SOCK_CLOEXEC

This code path was intended to only get executed on Linux, but unfortunately the
`cfg!` was malformed so it actually never got executed.
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/net.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/unix/net.rs b/src/libstd/sys/unix/net.rs
index a784741c88c..6f1b70acb60 100644
--- a/src/libstd/sys/unix/net.rs
+++ b/src/libstd/sys/unix/net.rs
@@ -67,7 +67,7 @@ impl Socket {
             // this option, however, was added in 2.6.27, and we still support
             // 2.6.18 as a kernel, so if the returned error is EINVAL we
             // fallthrough to the fallback.
-            if cfg!(linux) {
+            if cfg!(target_os = "linux") {
                 match cvt(libc::socket(fam, ty | SOCK_CLOEXEC, 0)) {
                     Ok(fd) => return Ok(Socket(FileDesc::new(fd))),
                     Err(ref e) if e.raw_os_error() == Some(libc::EINVAL) => {}
@@ -87,7 +87,7 @@ impl Socket {
             let mut fds = [0, 0];
 
             // Like above, see if we can set cloexec atomically
-            if cfg!(linux) {
+            if cfg!(target_os = "linux") {
                 match cvt(libc::socketpair(fam, ty | SOCK_CLOEXEC, 0, fds.as_mut_ptr())) {
                     Ok(_) => {
                         return Ok((Socket(FileDesc::new(fds[0])), Socket(FileDesc::new(fds[1]))));