Skip to content

Commit

Permalink
Merge pull request #1246 from softdevca/master
Browse files Browse the repository at this point in the history
/sys/class/hwmon* are not directories, they are symbolic links
  • Loading branch information
GuillaumeGomez committed Apr 9, 2024
2 parents 3faba91 + e00b455 commit 1533bbe
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 1533bbe

Please sign in to comment.