diff --git a/filedescriptor/src/unix.rs b/filedescriptor/src/unix.rs index 5863139e6..305d97e28 100644 --- a/filedescriptor/src/unix.rs +++ b/filedescriptor/src/unix.rs @@ -102,7 +102,7 @@ impl OwnedHandle { #[cfg(target_os = "linux")] pub(crate) fn dup_impl(fd: &F) -> Fallible { 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() {