From 0539f0b515b8acd916c27c2013d4aa8ff1fb6e99 Mon Sep 17 00:00:00 2001 From: Stefan Gehr Date: Mon, 2 Aug 2021 00:08:04 +0200 Subject: [PATCH] Workaround for service starting before hwmon paths Let the service fail when there are no hwmon paths yet. --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index a5d2479..6c1f2e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -145,6 +145,9 @@ fn controllers(config: &Config, filter: bool) -> std::io::Result> { fn service(config: Config) -> std::io::Result<()> { let mut controllers = controllers(&config, true)?; + if controllers.len() < 1 { + return Err(not_found()); + } let mut cache = std::collections::HashMap::new(); loop { for hw_mon in controllers.iter_mut() {