summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-09-19 09:23:59 -0500
committerDerek Foreman <derekf@osg.samsung.com>2016-09-19 09:23:59 -0500
commitbd1de560a1403a3e549938ae244f2f04f7e0b990 (patch)
treeb304b0e49946d8bb4e926ae9fb04b137a95ec9d9 /src
parent8550a33b27b35065b4f5bd6defbece003e1af0de (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eina/eina_cpu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/eina/eina_cpu.c b/src/lib/eina/eina_cpu.c
index 1de86d8387..b5e6b90d94 100644
--- a/src/lib/eina/eina_cpu.c
+++ b/src/lib/eina/eina_cpu.c
@@ -396,6 +396,9 @@ _eina_cpu_fast_core_get(void)
396 396
397 if (fastest_core_speed == 0) eina_cpu_map_init(); 397 if (fastest_core_speed == 0) eina_cpu_map_init();
398 398
399 /* Check again now that it's actually set up */
400 if (fastest_core_speed == -1) return -1;
401
399 corelist = eina_hash_find(cpu_hash, &fastest_core_speed); 402 corelist = eina_hash_find(cpu_hash, &fastest_core_speed);
400 cores = *corelist; 403 cores = *corelist;
401 bit = rand() % __builtin_popcount(cores); 404 bit = rand() % __builtin_popcount(cores);