better fix : if HW_AVAILCPU is defined, we use it, otherwise we use HW_NCPU

SVN revision: 42090
This commit is contained in:
Vincent Torri 2009-08-29 19:59:26 +00:00
parent 841aaa8f52
commit 2a5548f8e9
1 changed files with 6 additions and 6 deletions

View File

@ -151,15 +151,15 @@ EAPI int eina_cpu_count(void)
int cpus;
mib[0] = CTL_HW;
#ifdef HW_AVAILCPU
mib[1] = HW_AVAILCPU;
#else
mib[1] = HW_NCPU;
#end
sysctl(mib, 2, &cpus, &len, NULL, 0);
if (cpus < 1)
{
mib[1] = HW_NCPU;
sysctl(mib, 2, &cpus, &len, NULL, 0);
if (cpus < 1)
cpus = 1;
}
cpus = 1;
return cpus;
# elif defined (__linux__)