[gnome-builder] counter: don't immediately overwrite sched_getcpu()



commit 26493cb13c5a0d6d56020f991084f48daf0f7e34
Author: Christian Hergert <christian hergert me>
Date:   Mon Apr 18 19:18:34 2016 -0700

    counter: don't immediately overwrite sched_getcpu()
    
    We were always using fallback because we immediately overwrote our
    sched_getcpu() call.

 contrib/egg/egg-counter.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/contrib/egg/egg-counter.c b/contrib/egg/egg-counter.c
index 19a44e4..873fa9e 100644
--- a/contrib/egg/egg-counter.c
+++ b/contrib/egg/egg-counter.c
@@ -580,11 +580,13 @@ _egg_counter_getcpu_vdso_helper (void)
 }
 #endif
 
+#ifndef HAVE_SCHED_GETCPU
 static guint
 _egg_counter_getcpu_fallback (void)
 {
   return 0;
 }
+#endif
 
 #ifdef EGG_HAVE_RDTSCP
 static guint
@@ -614,9 +616,9 @@ _egg_counter_init_getcpu (void)
 
 #ifdef HAVE_SCHED_GETCPU
   _egg_counter_getcpu_helper = (guint (*) (void))sched_getcpu;
-#endif
-
+#else
   _egg_counter_getcpu_helper = _egg_counter_getcpu_fallback;
+#endif
 }
 
 guint


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]