From 87307775fc78c59b819b84c829cac727e2ea7f96 Mon Sep 17 00:00:00 2001 From: David Adam Date: Wed, 5 Jul 2023 10:30:26 +0800 Subject: [PATCH] fds: add comment on O_CLOEXEC fallback being dropped --- fish-rust/src/fds.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fish-rust/src/fds.rs b/fish-rust/src/fds.rs index b0c157fa7..04225d426 100644 --- a/fish-rust/src/fds.rs +++ b/fish-rust/src/fds.rs @@ -172,6 +172,8 @@ pub fn wopen_cloexec(pathname: &wstr, flags: i32, mode: libc::c_int) -> RawFd { /// Narrow versions of wopen_cloexec. pub fn open_cloexec(path: &CStr, flags: i32, mode: libc::c_int) -> RawFd { + // Port note: the C++ version of this function had a fallback for platforms where + // O_CLOEXEC is not supported, using fcntl. In 2023, this is no longer needed. unsafe { libc::open(path.as_ptr(), flags | O_CLOEXEC, mode) } }