summaryrefslogtreecommitdiffstats
path: root/src/os/shared.rs
diff options
context:
space:
mode:
authorValdemar Erk <valdemar@erk.io>2020-01-11 15:00:33 +0100
committerValdemar Erk <valdemar@erk.io>2020-01-12 23:19:57 +0100
commitdea95d406708522af438edf3bb2eeb992245cff6 (patch)
treeeafae1c44d6ff01f706fcfb597b06ed40a8324ab /src/os/shared.rs
parent21938b64859698f79447119e24dd5ae4b364b6d3 (diff)
Add support for more operating systems.
This commit will add support for operating systems that have the lsof tool, initially it will only work on MacOS and FreeBSD, but more operating systems may be added at a later time. Signed-off-by: Valdemar Erk <valdemar@erk.io>
Diffstat (limited to 'src/os/shared.rs')
-rw-r--r--src/os/shared.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/os/shared.rs b/src/os/shared.rs
index 55a8553..852d4f7 100644
--- a/src/os/shared.rs
+++ b/src/os/shared.rs
@@ -13,8 +13,8 @@ use signal_hook::iterator::Signals;
#[cfg(target_os = "linux")]
use crate::os::linux::get_open_sockets;
-#[cfg(target_os = "macos")]
-use crate::os::macos::get_open_sockets;
+#[cfg(any(target_os = "macos", target_os = "freebsd"))]
+use crate::os::lsof::get_open_sockets;
use crate::{network::dns, OsInputOutput};
pub type OnSigWinch = dyn Fn(Box<dyn Fn()>) + Send;
@@ -143,7 +143,7 @@ pub fn get_input(
}
#[inline]
-#[cfg(target_os = "macos")]
+#[cfg(any(target_os = "macos", target_os = "freebsd"))]
fn eperm_message() -> &'static str {
"Insufficient permissions to listen on network interface(s). Try running with sudo."
}