From cbcaedf3699619739f33c3671d0dcb8b97847b92 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Sat, 12 Jun 2021 20:39:12 +0200 Subject: [PATCH] Set FD_CLOEXEC flag on duplicated kqueue Poll Same as commit c52635c76a59be28d0bf287a0bad6d6871a2e36c, but for kqueue. --- src/sys/unix/selector/kqueue.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sys/unix/selector/kqueue.rs b/src/sys/unix/selector/kqueue.rs index 34f534028..c5b337bca 100644 --- a/src/sys/unix/selector/kqueue.rs +++ b/src/sys/unix/selector/kqueue.rs @@ -87,7 +87,7 @@ impl Selector { } pub fn try_clone(&self) -> io::Result { - syscall!(dup(self.kq)).map(|kq| Selector { + syscall!(fcntl(self.kq, libc::F_DUPFD_CLOEXEC)).map(|kq| Selector { // It's the same selector, so we use the same id. #[cfg(debug_assertions)] id: self.id,