From 80109fd8aa0239c381ca81c817fcbb53bddafe62 Mon Sep 17 00:00:00 2001 From: lbl8603 <49143209+lbl8603@users.noreply.github.com> Date: Tue, 7 Feb 2023 17:43:38 +0800 Subject: [PATCH] Update tun_handler.rs --- switch/src/handle/tun_handler.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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;