From db3f2505af80df7c8711ffebaa2eccb7f21bad2f Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Mon, 18 Jul 2022 19:43:44 +0200 Subject: [PATCH] Fix epoll O_CLOEXEC usage Switched O_CLOEXEC and EPOLL_CLOEXEC around in the last commit. --- src/sys/unix/selector/epoll.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sys/unix/selector/epoll.rs b/src/sys/unix/selector/epoll.rs index 074d3a8e..99a7a2a3 100644 --- a/src/sys/unix/selector/epoll.rs +++ b/src/sys/unix/selector/epoll.rs @@ -24,7 +24,7 @@ pub struct Selector { impl Selector { pub fn new() -> io::Result { #[cfg(not(target_os = "android"))] - let res = syscall!(epoll_create1(libc::O_CLOEXEC)); + let res = syscall!(epoll_create1(libc::EPOLL_CLOEXEC)); // On Android < API level 16 `epoll_create1` is not defined, so use a // raw system call. @@ -32,7 +32,7 @@ impl Selector { // 21. But `EPOLL_CLOEXEC` is an alias for `O_CLOEXEC` on that platform, // so we use it instead. #[cfg(target_os = "android")] - let res = syscall!(syscall(libc::SYS_epoll_create1, libc::EPOLL_CLOEXEC)); + let res = syscall!(syscall(libc::SYS_epoll_create1, libc::O_CLOEXEC)); let ep = match res { Ok(ep) => ep as RawFd,