summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2023-06-11 04:01:14 +0000
committerGitHub <noreply@github.com>2023-06-11 00:01:14 -0400
commit2ba7394ac203988e56eaecc508bb5c75d93295d3 (patch)
tree38168ee774288bc0fe76ec3d3e4c531ce0fbca53
parent13a8e5bf0e0453a03e94cdc05cbbfd8503efa915 (diff)
other: have dummy fallback for disk I/O for unsupported OSes (#1198)
-rw-r--r--src/app/data_harvester/disks.rs6
1 files changed, 5 insertions, 1 deletions
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<String, Option<IoData>>;
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<IoHarvest> {
+ anyhow::bail!("Unsupported OS");
+ }
}
}