eina_cpu: Fix error handling in eina_cpu_fast_core_get
I introduced a crash on linux systems where the cpufreq directory doesn't exist. This fixes it.
This commit is contained in:
parent
8550a33b27
commit
bd1de560a1
|
@ -396,6 +396,9 @@ _eina_cpu_fast_core_get(void)
|
|||
|
||||
if (fastest_core_speed == 0) eina_cpu_map_init();
|
||||
|
||||
/* Check again now that it's actually set up */
|
||||
if (fastest_core_speed == -1) return -1;
|
||||
|
||||
corelist = eina_hash_find(cpu_hash, &fastest_core_speed);
|
||||
cores = *corelist;
|
||||
bit = rand() % __builtin_popcount(cores);
|
||||
|
|
Loading…
Reference in New Issue