From b5cbdccf5786bce5d3fae04a2df45d706828f432 Mon Sep 17 00:00:00 2001 From: Dustin Thomson Date: Mon, 1 Apr 2024 10:56:26 -0600 Subject: [PATCH] Fix android build Ensure fd variable are defined on android Signed-off-by: Dustin Thomson --- src/sync/sys/unix/net.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sync/sys/unix/net.rs b/src/sync/sys/unix/net.rs index 3fdf47b..8f724d6 100644 --- a/src/sync/sys/unix/net.rs +++ b/src/sync/sys/unix/net.rs @@ -62,7 +62,7 @@ impl PipeListener { } fn new_monitor_fd() -> Result<(i32, i32)> { - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", target_os = "android"))] let fds = pipe2(nix::fcntl::OFlag::O_CLOEXEC)?; @@ -128,7 +128,7 @@ impl PipeListener { return Err(io::Error::new(io::ErrorKind::Other, "listener shutdown for quit flag")); } - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", target_os = "android"))] let fd = match accept4(self.fd, SockFlag::SOCK_CLOEXEC) { Ok(fd) => fd, Err(e) => {