Update tun_handler.rs

This commit is contained in:
lbl8603
2023-02-07 17:37:03 +08:00
committed by GitHub
parent ad5aac7ef5
commit c631f2bb0d
+3 -1
View File
@@ -148,7 +148,9 @@ pub async fn handler_start<F>(
) where ) where
F: FnOnce() + Send + 'static, F: FnOnce() + Send + 'static,
{ {
use std::os::fd::AsRawFd; #[cfg(target_os = "linux")]
use std::os::unix::io::AsRawFd;
#[cfg(target_os = "macos")]
let raw_fd = tun_reader.0.as_raw_fd(); let raw_fd = tun_reader.0.as_raw_fd();
tokio::spawn(async move { tokio::spawn(async move {
let _ = status_watch.changed().await; let _ = status_watch.changed().await;