]> git.lizzy.rs Git - rust.git/commitdiff
Haiku: Work around the lack of the FIOCLEX ioctl
authorNiels Sascha Reedijk <niels.reedijk@gmail.com>
Sun, 25 Sep 2016 04:41:29 +0000 (23:41 -0500)
committerAlexander von Gluck IV <kallisti5@unixzen.com>
Sun, 25 Sep 2016 16:13:57 +0000 (11:13 -0500)
* Hand rebased from Niels original work on 1.9.0

src/libstd/sys/unix/fd.rs

index 8bca6d469b7371faed045253df37e65f66c3f740..60c1750b4693c965b9a16c50f2af30e2a0ce561d 100644 (file)
@@ -59,14 +59,20 @@ pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
         Ok(ret as usize)
     }
 
-    #[cfg(not(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten")))]
+    #[cfg(not(any(target_env = "newlib",
+                  target_os = "solaris",
+                  target_os = "emscripten",
+                  target_os = "haiku")))]
     pub fn set_cloexec(&self) -> io::Result<()> {
         unsafe {
             cvt(libc::ioctl(self.fd, libc::FIOCLEX))?;
             Ok(())
         }
     }
-    #[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))]
+    #[cfg(any(target_env = "newlib",
+              target_os = "solaris",
+              target_os = "emscripten",
+              target_os = "haiku"))]
     pub fn set_cloexec(&self) -> io::Result<()> {
         unsafe {
             let previous = cvt(libc::fcntl(self.fd, libc::F_GETFD))?;