Skip to content

Commit 4694950

Browse files
committed
Add changes from FileDesc to NetFileDesc.
1 parent 74f5919 commit 4694950

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libstd/sys/unix/net_fd.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use crate::cmp;
44
use crate::io::{self, Initializer, IoSlice, IoSliceMut, Read};
55
use crate::mem;
6+
use crate::sync::atomic::{AtomicBool, Ordering};
67
use crate::sys::{
78
cvt,
89
net::netc::{self, c_int, c_void, ssize_t},
@@ -105,6 +106,7 @@ impl NetFileDesc {
105106
#[cfg(not(any(
106107
target_env = "newlib",
107108
target_os = "solaris",
109+
target_os = "illumos",
108110
target_os = "emscripten",
109111
target_os = "fuchsia",
110112
target_os = "l4re",
@@ -122,6 +124,7 @@ impl NetFileDesc {
122124
any(
123125
target_env = "newlib",
124126
target_os = "solaris",
127+
target_os = "illumos",
125128
target_os = "emscripten",
126129
target_os = "fuchsia",
127130
target_os = "l4re",
@@ -150,8 +153,6 @@ impl NetFileDesc {
150153
}
151154

152155
pub fn duplicate(&self) -> io::Result<NetFileDesc> {
153-
use crate::sync::atomic::{AtomicBool, Ordering};
154-
155156
// We want to atomically duplicate this file descriptor and set the
156157
// CLOEXEC flag, and currently that's done via F_DUPFD_CLOEXEC. This
157158
// flag, however, isn't supported on older Linux kernels (earlier than
@@ -189,7 +190,7 @@ impl NetFileDesc {
189190
make_filedesc(fd)?
190191
} else {
191192
NetFileDesc::new(fd)
192-
})
193+
});
193194
}
194195
Err(ref e) if e.raw_os_error() == Some(netc::EINVAL) => {
195196
TRY_CLOEXEC.store(false, Ordering::Relaxed);

0 commit comments

Comments
 (0)