Skip to content

Commit

Permalink
mtr: handle the case of existing but unreadable /proc/cpuinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Jun 2, 2023
1 parent d14c485 commit aca641d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions mysql-test/lib/My/SysInfo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ sub _cpuinfo {
}
}
$F= undef; # Close file
return $self;
return $self->{cpus};
}


Expand All @@ -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};
}


Expand Down

0 comments on commit aca641d

Please sign in to comment.