Skip to content

Commit 45db5ed

Browse files
glaubitzgitster
authored andcommitted
chainlint.pl: fix incorrect CPU count on Linux SPARC
On SPARC systems running Linux, individual processors are denoted with "CPUnn:" in /proc/cpuinfo instead of the usual "processor : NN". As a result, the regexp in ncores() matches 0 times. Address this shortcoming by extending the regexp to also match lines with "CPUnn:". Signed-off-by: John Paul Adrian Glaubitz <[email protected]> [es: simplified regexp; tweaked commit message] Signed-off-by: Eric Sunshine <[email protected]> Tested-by: John Paul Adrian Glaubitz <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 037348e commit 45db5ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/chainlint.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ sub ncores {
715715
if (open my $fh, '<', '/proc/cpuinfo') {
716716
my $cpuinfo = do { local $/; <$fh> };
717717
close($fh);
718-
my @matches = ($cpuinfo =~ /^processor[\s\d]*:/mg);
718+
my @matches = ($cpuinfo =~ /^(processor|CPU)[\s\d]*:/mg);
719719
return @matches ? scalar(@matches) : 1;
720720
}
721721
# macOS & BSD

0 commit comments

Comments
 (0)