Message ID | 20240520190131.94904-4-ericsunshine@charter.net (mailing list archive) |
---|---|
State | Accepted |
Commit | 2e7e9205beb5a745f91d0d0ce772c7b447c3aba8 |
Headers | show |
Series | chainlint.pl: Extend regexp pattern for /proc/cpuinfo on Linux SPARC | expand |
diff --git a/t/chainlint.pl b/t/chainlint.pl index d593cb95e7..1bbd985b78 100755 --- a/t/chainlint.pl +++ b/t/chainlint.pl @@ -724,6 +724,9 @@ sub ncores { if (open my $fh, '<', '/proc/cpuinfo') { my $cpuinfo = do { local $/; <$fh> }; close($fh); + if ($cpuinfo =~ /^n?cpus active\s*:\s*(\d+)/m) { + return $1 if $1 > 0; + } my @matches = ($cpuinfo =~ /^(processor|CPU)[\s\d]*:/mg); return @matches ? scalar(@matches) : 1; }