aboutsummaryrefslogtreecommitdiff
path: root/src/common/cpucores.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/cpucores.h')
-rw-r--r--src/common/cpucores.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/cpucores.h b/src/common/cpucores.h
index 330cd9c9..370c3cec 100644
--- a/src/common/cpucores.h
+++ b/src/common/cpucores.h
@@ -40,7 +40,7 @@ cpucores(void)
int name[2] = { CTL_HW, HW_NCPU };
int cpus;
size_t cpus_size = sizeof(cpus);
- if (!sysctl(name, 2, &cpus, &cpus_size, NULL, 0)
+ if (sysctl(name, 2, &cpus, &cpus_size, NULL, 0) != -1
&& cpus_size == sizeof(cpus) && cpus > 0)
ret = (uint32_t)(cpus);
#endif