Auto merge of #30270 - DiamondLovesYou:fix-30231, r=alexcrichton
Closes #30231
This commit is contained in:
commit
08a5b112ed
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user