Skip to content

Commit

Permalink
facts: Prevent inability to access MSRs from showing availible facts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjj20 committed Jun 11, 2024
1 parent eb8b71f commit 4235870
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,13 @@ impl Command for Facts {
let msr = {
#[cfg(feature = "use_msr")]
{
Box::new(msr::linux::LinuxMsrStore::new()?) as Box<dyn MsrStore>
match msr::linux::LinuxMsrStore::new() {
Ok(store) => Box::new(store) as Box<dyn MsrStore>,
Err(e) => {
eprintln!("Error accessing MSRs: {}", e);
Box::new(msr::EmptyMSR {})
}
}
}
#[cfg(not(feature = "use_msr"))]
{
Expand Down

0 comments on commit 4235870

Please sign in to comment.