Fix half of emscripten's failing tests

This commit is contained in:
Pierre Krieger 2016-02-10 10:28:51 +01:00
parent 0d410b8d2a
commit 173037840e
2 changed files with 9 additions and 7 deletions

View file

@ -51,14 +51,14 @@ impl FileDesc {
Ok(ret as usize)
}
#[cfg(not(any(target_env = "newlib", target_os = "solaris")))]
#[cfg(not(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten")))]
pub fn set_cloexec(&self) {
unsafe {
let ret = libc::ioctl(self.fd, libc::FIOCLEX);
debug_assert_eq!(ret, 0);
}
}
#[cfg(any(target_env = "newlib", target_os = "solaris"))]
#[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))]
pub fn set_cloexec(&self) {
unsafe {
let previous = libc::fcntl(self.fd, libc::F_GETFD);