]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/common.pm
Merge pull request #1139 from johanna-a/master
[user/henk/code/inspircd.git] / make / common.pm
index 638cc668ae3fd9d53a2e33c4a38ba069726769c3..f5bbedb3feda504d1eda3d3f594ae810a2a997d6 100644 (file)
@@ -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;