derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=bd1de560a1403a3e549938ae244f2f04f7e0b990

commit bd1de560a1403a3e549938ae244f2f04f7e0b990
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Mon Sep 19 09:23:59 2016 -0500

    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.
---
 src/lib/eina/eina_cpu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lib/eina/eina_cpu.c b/src/lib/eina/eina_cpu.c
index 1de86d8..b5e6b90 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)
 
    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);

-- 


Reply via email to