diff --git a/switch/src/handle/tun_handler.rs b/switch/src/handle/tun_handler.rs index e14200f..3248503 100644 --- a/switch/src/handle/tun_handler.rs +++ b/switch/src/handle/tun_handler.rs @@ -148,9 +148,10 @@ pub async fn handler_start( ) where F: FnOnce() + Send + 'static, { - #[cfg(target_os = "linux")] - use std::os::unix::io::AsRawFd; - #[cfg(target_os = "macos")] + #[cfg(target_os = "linux")] + use std::os::unix::io::AsRawFd; + #[cfg(target_os = "macos")] + use std::os::fd::AsRawFd; let raw_fd = tun_reader.0.as_raw_fd(); tokio::spawn(async move { let _ = status_watch.changed().await;