From e00b455ac1cb2e1dab818e87c60cfb8860a9e426 Mon Sep 17 00:00:00 2001 From: Sheldon Young Date: Tue, 9 Apr 2024 14:25:14 -0700 Subject: [PATCH] /sys/class/hwmon* are not directories, they are symbolic links - fixes #1245 --- src/unix/linux/component.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/unix/linux/component.rs b/src/unix/linux/component.rs index 60f62af43..4169421dd 100644 --- a/src/unix/linux/component.rs +++ b/src/unix/linux/component.rs @@ -374,16 +374,15 @@ impl ComponentsInner { continue; }; let entry = entry.path(); - if !file_type.is_dir() - || !entry + if !file_type.is_file() + && entry .file_name() .and_then(|x| x.to_str()) .unwrap_or("") .starts_with("hwmon") { - continue; + ComponentInner::from_hwmon(&mut self.components, &entry); } - ComponentInner::from_hwmon(&mut self.components, &entry); } } }