From c36146989890a075dbc9adecea20353f98f08378 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 20 Feb 2016 10:34:41 +0000 Subject: Fix not having a CPU count when the lookup command is missing. --- make/common.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'make') diff --git a/make/common.pm b/make/common.pm index 638cc668a..f5bbedb3f 100644 --- a/make/common.pm +++ b/make/common.pm @@ -76,13 +76,13 @@ sub module_installed($) { sub get_cpu_count { my $count = 1; if ($^O =~ /bsd/) { - $count = `sysctl -n hw.ncpu`; + $count = `sysctl -n hw.ncpu 2>/dev/null` || 1; } elsif ($^O eq 'darwin') { - $count = `sysctl -n hw.activecpu`; + $count = `sysctl -n hw.activecpu 2>/dev/null` || 1; } elsif ($^O eq 'linux') { - $count = `getconf _NPROCESSORS_ONLN`; + $count = `getconf _NPROCESSORS_ONLN 2>/dev/null` || 1; } elsif ($^O eq 'solaris') { - $count = `psrinfo -p`; + $count = `psrinfo -p 2>/dev/null` || 1; } chomp($count); return $count; -- cgit v1.2.3