forked from enlightenment/efl
better fix : if HW_AVAILCPU is defined, we use it, otherwise we use HW_NCPU
SVN revision: 42090
This commit is contained in:
parent
841aaa8f52
commit
2a5548f8e9
|
@ -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__)
|
||||
|
|
Loading…
Reference in New Issue