mtr: handle the case of existing but unreadable /proc/cpuinfo

This commit is contained in:
Sergei Golubchik 2023-05-31 14:40:17 +02:00
parent d14c485e1c
commit aca641da28

View File

@ -68,7 +68,7 @@ sub _cpuinfo {
}
}
$F= undef; # Close file
return $self;
return $self->{cpus};
}
@ -95,12 +95,7 @@ sub _kstat {
push(@{$self->{cpus}}, $cpuinfo);
}
# At least one cpu should have been found
# if this method worked
if ( $self->{cpus} ) {
return $self;
}
return undef;
return $self->{cpus};
}