diff options
author | Attila Molnar <attilamolnar@hush.com> | 2016-02-20 16:29:55 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2016-02-20 16:29:55 +0100 |
commit | 0cfe4a848b06d8b8b277a7afc90ceabcaa50d9fa (patch) | |
tree | 3d7a014f302e9e5a6c7e92e970f0fafd71a6ed77 /make/common.pm | |
parent | 14b220b8d322146e1fc2393640b4292b4be1257b (diff) | |
parent | 7e767774b496c13677a488c17cf46223655b19fb (diff) |
Merge pull request #1142 from SaberUK/master+fixes
Fix various build problems on CentOS, OpenBSD, and Solaris.
Diffstat (limited to 'make/common.pm')
-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; |