Commit 038b0bd3 authored by David Lawrence's avatar David Lawrence
Browse files

return the number of ncpus, instead of whatever random crap is on the stack

parent 06430b1f
......@@ -23,13 +23,13 @@
unsigned int
isc_os_ncpus(void) {
#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
long ncpus;
long ncpus = 1;
#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
ncpus = sysconf(_SC_NPROCESSORS_ONLN);
if (ncpus <= 0)
return (1);
#else
return (1);
ncpus = 1;
#endif
return ((unsigned int)ncpus);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment