diff options
-rw-r--r-- | make/common.pm | 8 |
1 files changed, 4 insertions, 4 deletions
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; |