diff options
Diffstat (limited to 'src/cpulimit.c')
-rw-r--r-- | src/cpulimit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cpulimit.c b/src/cpulimit.c index 9b25b87..dc61c3b 100644 --- a/src/cpulimit.c +++ b/src/cpulimit.c @@ -147,7 +147,7 @@ static void increase_priority() { /* Get the number of CPUs */ static int get_ncpu() { - int ncpu = -1; + int ncpu; #ifdef _SC_NPROCESSORS_ONLN ncpu = sysconf(_SC_NPROCESSORS_ONLN); #elif defined __APPLE__ @@ -156,6 +156,8 @@ static int get_ncpu() { sysctl(mib, 2, &ncpu, &len, NULL, 0); #elif defined _GNU_SOURCE ncpu = get_nprocs(); +#else + ncpu = -1; #endif return ncpu; } |