about summary refs log tree commit diff
path: root/src/libstd/sys/vxworks/net.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-26 18:56:47 +0200
committerGitHub <noreply@github.com>2019-07-26 18:56:47 +0200
commitceea0be207f8a32b71142e9b5d2a4e9befcbe705 (patch)
tree2744cf16f88cb9178b855922dedfb775b4083fc0 /src/libstd/sys/vxworks/net.rs
parent5ffdca77c44f3233abe389890ba73e966d90406d (diff)
parent279c399599357cdb40d2bbe24a769d2d1dd4a9d9 (diff)
downloadrust-ceea0be207f8a32b71142e9b5d2a4e9befcbe705.tar.gz
rust-ceea0be207f8a32b71142e9b5d2a4e9befcbe705.zip
Rollup merge of #62862 - BaoshanPang:cleanup, r=alexcrichton
code cleanup

remove all codes that are not used by vxWorks
Diffstat (limited to 'src/libstd/sys/vxworks/net.rs')
-rw-r--r--src/libstd/sys/vxworks/net.rs13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/libstd/sys/vxworks/net.rs b/src/libstd/sys/vxworks/net.rs
index 686cea49a6e..aa6b93c8600 100644
--- a/src/libstd/sys/vxworks/net.rs
+++ b/src/libstd/sys/vxworks/net.rs
@@ -58,19 +58,6 @@ impl Socket {
 
     pub fn new_raw(fam: c_int, ty: c_int) -> io::Result<Socket> {
         unsafe {
-            // On linux we first attempt to pass the SOCK_CLOEXEC flag to
-            // atomically create the socket and set it as CLOEXEC. Support for
-            // 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!(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) => {}
-                    Err(e) => return Err(e),
-                }
-            }
-
             let fd = cvt(libc::socket(fam, ty, 0))?;
             let fd = FileDesc::new(fd);
             fd.set_cloexec()?;