From 2305536b3b8fd5ef602fe57f35e9097d0dc1f3fd Mon Sep 17 00:00:00 2001 From: pooler Date: Fri, 13 Dec 2013 14:19:35 +0100 Subject: [PATCH] Fix processor count detection with HW_NCPU --- cpu-miner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu-miner.c b/cpu-miner.c index 6792c82..49f8f3d 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -1312,10 +1312,10 @@ int main(int argc, char *argv[]) num_processors = sysinfo.dwNumberOfProcessors; #elif defined(_SC_NPROCESSORS_CONF) num_processors = sysconf(_SC_NPROCESSORS_CONF); -#elif defined(HW_NCPU) +#elif defined(CTL_HW) && defined(HW_NCPU) int req[] = { CTL_HW, HW_NCPU }; size_t len = sizeof(num_processors); - v = sysctl(req, 2, &num_processors, &len, NULL, 0); + sysctl(req, 2, &num_processors, &len, NULL, 0); #else num_processors = 1; #endif