From 53356a1e67058b0ca1dc36de0cb626e1015cb13f Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Sun, 9 Jun 2024 14:28:11 +0200 Subject: [PATCH] Fix import on Android --- src/sys/unix/uds/mod.rs | 4 +++- tests/unix_listener.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sys/unix/uds/mod.rs b/src/sys/unix/uds/mod.rs index 452be3bb0..42508612b 100644 --- a/src/sys/unix/uds/mod.rs +++ b/src/sys/unix/uds/mod.rs @@ -1,4 +1,6 @@ -#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(target_os = "android")] +use std::os::android::net::SocketAddrExt; +#[cfg(target_os = "linux")] use std::os::linux::net::SocketAddrExt; use std::os::unix::ffi::OsStrExt; use std::os::unix::io::FromRawFd; diff --git a/tests/unix_listener.rs b/tests/unix_listener.rs index 4fb033ab0..c13e9cbb6 100644 --- a/tests/unix_listener.rs +++ b/tests/unix_listener.rs @@ -134,7 +134,7 @@ fn unix_listener_deregister() { } #[test] -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "android", target_os = "linux"))] fn unix_listener_abstract_namespace() { use rand::Rng; use std::os::linux::net::SocketAddrExt;