Skip to content

Commit 1f51b77

Browse files
panlinuxgitster
authored andcommitted
chainlint.pl: fix /proc/cpuinfo regexp
29fb2ec (chainlint.pl: validate test scripts in parallel, 2022-09-01) introduced a function that gets the number of cores from /proc/cpuinfo on some systems, notably linux. The regexp it uses (^processor\s*:) fails to match the desired lines in the s390x architecture, where they look like this: processor 0: version = FF, identification = 148F67, machine = 2964 As a result, on s390x that function returns 0 as the number of cores, and the chainlint.pl script exits without doing anything. Signed-off-by: Andreas Hasenack <[email protected]> Acked-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e7e5c6f commit 1f51b77

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
@@ -656,7 +656,7 @@ sub ncores {
656656
# Windows
657657
return $ENV{NUMBER_OF_PROCESSORS} if exists($ENV{NUMBER_OF_PROCESSORS});
658658
# Linux / MSYS2 / Cygwin / WSL
659-
do { local @ARGV='/proc/cpuinfo'; return scalar(grep(/^processor\s*:/, <>)); } if -r '/proc/cpuinfo';
659+
do { local @ARGV='/proc/cpuinfo'; return scalar(grep(/^processor[\s\d]*:/, <>)); } if -r '/proc/cpuinfo';
660660
# macOS & BSD
661661
return qx/sysctl -n hw.ncpu/ if $^O =~ /(?:^darwin$|bsd)/;
662662
return 1;

0 commit comments

Comments
 (0)