diff options
| author | bors <bors@rust-lang.org> | 2019-07-30 03:38:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-07-30 03:38:54 +0000 |
| commit | 4eeaaa722d6ac6d24de6e4d3faefb7c44e674b37 (patch) | |
| tree | ed3ee28acaee8ae750947dd3a224d9d1801e713d /src/libstd/sys | |
| parent | 04b88a9eba8abbac87eddcb2998beea09589c2c9 (diff) | |
| parent | 91c10f8839156b3c3001271be17995806fb74e06 (diff) | |
| download | rust-4eeaaa722d6ac6d24de6e4d3faefb7c44e674b37.tar.gz rust-4eeaaa722d6ac6d24de6e4d3faefb7c44e674b37.zip | |
Auto merge of #63124 - Centril:rollup-onohtqt, r=Centril
Rollup of 12 pull requests Successful merges: - #61965 (Remove mentions of removed `offset_to` method from `align_offset` docs) - #62928 (Syntax: Recover on `for ( $pat in $expr ) $block`) - #63000 (Impl Debug for Chars) - #63083 (Make generic parameters always use modern hygiene) - #63087 (Add very simple edition check to tidy.) - #63093 (Properly check the defining scope of existential types) - #63096 (Add tests for some `existential_type` ICEs) - #63099 (vxworks: Remove Linux-specific comments.) - #63106 (ci: Skip installing SWIG/xz on OSX ) - #63108 (Add links to None in Option doc) - #63109 (std: Fix a failing `fs` test on Windows) - #63111 (Add syntactic and semantic tests for rest patterns, i.e. `..`) Failed merges: r? @ghost
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/vxworks/fs.rs | 17 | ||||
| -rw-r--r-- | src/libstd/sys/vxworks/net.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/vxworks/pipe.rs | 5 |
3 files changed, 1 insertions, 25 deletions
diff --git a/src/libstd/sys/vxworks/fs.rs b/src/libstd/sys/vxworks/fs.rs index 4eb185c4d57..d537d2258fd 100644 --- a/src/libstd/sys/vxworks/fs.rs +++ b/src/libstd/sys/vxworks/fs.rs @@ -287,22 +287,7 @@ impl File { let fd = cvt_r(|| unsafe { open(path.as_ptr(), flags, opts.mode as c_int) })?; - let fd = FileDesc::new(fd); - // Currently the standard library supports Linux 2.6.18 which did not - // have the O_CLOEXEC flag (passed above). If we're running on an older - // Linux kernel then the flag is just ignored by the OS. After we open - // the first file, we check whether it has CLOEXEC set. If it doesn't, - // we will explicitly ask for a CLOEXEC fd for every further file we - // open, if it does, we will skip that step. - // - // The CLOEXEC flag, however, is supported on versions of macOS/BSD/etc - // that we support, so we only do this on Linux currently. - fn ensure_cloexec(_: &FileDesc) -> io::Result<()> { - Ok(()) - } - - ensure_cloexec(&fd)?; - Ok(File(fd)) + Ok(File(FileDesc::new(fd))) } pub fn file_attr(&self) -> io::Result<FileAttr> { diff --git a/src/libstd/sys/vxworks/net.rs b/src/libstd/sys/vxworks/net.rs index aa6b93c8600..56962e11dcf 100644 --- a/src/libstd/sys/vxworks/net.rs +++ b/src/libstd/sys/vxworks/net.rs @@ -141,10 +141,6 @@ impl Socket { pub fn accept(&self, storage: *mut sockaddr, len: *mut socklen_t) -> io::Result<Socket> { - // Unfortunately the only known way right now to accept a socket and - // atomically set the CLOEXEC flag is to use the `accept4` syscall on - // Linux. This was added in 2.6.28, however, and because we support - // 2.6.18 we must detect this support dynamically. let fd = cvt_r(|| unsafe { libc::accept(self.0.raw(), storage, len) })?; diff --git a/src/libstd/sys/vxworks/pipe.rs b/src/libstd/sys/vxworks/pipe.rs index 83637832ff3..e09dbe6e99b 100644 --- a/src/libstd/sys/vxworks/pipe.rs +++ b/src/libstd/sys/vxworks/pipe.rs @@ -11,11 +11,6 @@ pub fn anon_pipe() -> io::Result<(AnonPipe, AnonPipe)> { static INVALID: AtomicBool = AtomicBool::new(false); let mut fds = [0; 2]; - - // Unfortunately the only known way right now to create atomically set the - // CLOEXEC flag is to use the `pipe2` syscall on Linux. This was added in - // 2.6.27, however, and because we support 2.6.18 we must detect this - // support dynamically. cvt(unsafe { libc::pipe(fds.as_mut_ptr()) })?; let fd0 = FileDesc::new(fds[0]); |
