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:
Derek Foreman 2016-09-19 09:23:59 -05:00
parent 8550a33b27
commit bd1de560a1
1 changed files with 3 additions and 0 deletions

View File

@ -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);