Skip to content

Commit

Permalink
/sys/class/hwmon* are not directories, they are symbolic links - fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
softdevca committed Apr 9, 2024
1 parent 3faba91 commit e00b455
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/unix/linux/component.rs
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit e00b455

Please sign in to comment.