1
1
mirror of https://github.com/wez/wezterm.git synced 2024-08-17 10:10:23 +03:00

fix F_DUPFD_CLOEXEC usage

This commit is contained in:
Wez Furlong 2019-05-19 11:54:05 -07:00
parent ca15d6da1a
commit 135a191b57

View File

@ -102,7 +102,7 @@ impl OwnedHandle {
#[cfg(target_os = "linux")]
pub(crate) fn dup_impl<F: AsRawFileDescriptor>(fd: &F) -> Fallible<Self> {
let fd = fd.as_raw_file_descriptor();
let duped = unsafe { libc::fcntl(fd, libc::F_DUPFD_CLOEXEC) };
let duped = unsafe { libc::fcntl(fd, libc::F_DUPFD_CLOEXEC, 0) };
if duped == -1 {
let err = std::io::Error::last_os_error();
if let Some(libc::EINVAL) = err.raw_os_error() {