Fix a typo in fd.rs. Fixes #30231.

This commit is contained in:
Richard Diamond
2015-12-08 12:38:37 -06:00
parent 7540dcd8df
commit 3a6fd55fd1

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);
}
}