From aca641da288b91f4b4e90bb3eb3d6ecca52186fa Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 31 May 2023 14:40:17 +0200 Subject: [PATCH] mtr: handle the case of existing but unreadable /proc/cpuinfo --- mysql-test/lib/My/SysInfo.pm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm index 1e5ac353def..211f72c0561 100644 --- a/mysql-test/lib/My/SysInfo.pm +++ b/mysql-test/lib/My/SysInfo.pm @@ -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}; }