Auto merge of #30270 - DiamondLovesYou:fix-30231, r=alexcrichton

Closes #30231
This commit is contained in:
bors 2015-12-09 18:42:15 +00:00
commit 08a5b112ed

View File

@ -60,8 +60,8 @@ impl FileDesc {
#[cfg(target_env = "newlib")]
pub fn set_cloexec(&self) {
unsafe {
let previous = libc::fnctl(self.fd, libc::F_GETFD);
let ret = libc::fnctl(self.fd, libc::F_SETFD, previous | libc::FD_CLOEXEC);
let previous = libc::fcntl(self.fd, libc::F_GETFD);
let ret = libc::fcntl(self.fd, libc::F_SETFD, previous | libc::FD_CLOEXEC);
debug_assert_eq!(ret, 0);
}
}