We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8052f73 commit 15cd5a1Copy full SHA for 15cd5a1
src/libstd/sys/unix/net.rs
@@ -67,7 +67,7 @@ impl Socket {
67
// this option, however, was added in 2.6.27, and we still support
68
// 2.6.18 as a kernel, so if the returned error is EINVAL we
69
// fallthrough to the fallback.
70
- if cfg!(linux) {
+ if cfg!(target_os = "linux") {
71
match cvt(libc::socket(fam, ty | SOCK_CLOEXEC, 0)) {
72
Ok(fd) => return Ok(Socket(FileDesc::new(fd))),
73
Err(ref e) if e.raw_os_error() == Some(libc::EINVAL) => {}
@@ -87,7 +87,7 @@ impl Socket {
87
let mut fds = [0, 0];
88
89
// Like above, see if we can set cloexec atomically
90
91
match cvt(libc::socketpair(fam, ty | SOCK_CLOEXEC, 0, fds.as_mut_ptr())) {
92
Ok(_) => {
93
return Ok((Socket(FileDesc::new(fds[0])), Socket(FileDesc::new(fds[1]))));
0 commit comments