mtr: handle the case of existing but unreadable /proc/cpuinfo
This commit is contained in:
parent
d14c485e1c
commit
aca641da28
@ -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};
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user