From 2ba7394ac203988e56eaecc508bb5c75d93295d3 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Sun, 11 Jun 2023 04:01:14 +0000 Subject: [PATCH] other: have dummy fallback for disk I/O for unsupported OSes (#1198) --- src/app/data_harvester/disks.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/data_harvester/disks.rs b/src/app/data_harvester/disks.rs index 146965be..6f98d3f2 100644 --- a/src/app/data_harvester/disks.rs +++ b/src/app/data_harvester/disks.rs @@ -46,7 +46,7 @@ pub struct IoData { pub type IoHarvest = HashMap>; cfg_if! { - if #[cfg(not(target_os = "freebsd"))] { + if #[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] { mod io_counters; pub use io_counters::IoCounters; @@ -68,6 +68,10 @@ cfg_if! { Ok(io_hash) } + } else if #[cfg(not(target_os = "freebsd"))] { + pub fn get_io_usage() -> anyhow::Result { + anyhow::bail!("Unsupported OS"); + } } }