From c6a855363bfc59fbe197bba73bf64b5d920946a1 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 1 May 2014 12:33:34 +1200 Subject: Completed debug stuff --- freq_tray/getcore.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'freq_tray/getcore.c') diff --git a/freq_tray/getcore.c b/freq_tray/getcore.c index a2ee3d3..44b3940 100644 --- a/freq_tray/getcore.c +++ b/freq_tray/getcore.c @@ -22,17 +22,17 @@ #include #include -int NUMBER_OF_CORES; +unsigned int NUMBER_OF_CORES; -static gboolean core_exists(int core) +static gboolean core_exists(unsigned int core) { FILE* fd; char path[80]; char corestr[4]; - sprintf(corestr, "%i", core); + sprintf(corestr, "%d", core); sprintf(path, "/sys/devices/system/cpu/cpu%s/cpufreq/scaling_cur_freq", corestr); - + debug("Checking if core %d exists by opening '%s'",core,path); return (gboolean)(fd = fopen(path, "r")); } @@ -40,6 +40,7 @@ void gc_init() { NUMBER_OF_CORES = 0; while(core_exists(++NUMBER_OF_CORES)); + debug("Found %d cores\n",NUMBER_OF_CORES); } -- cgit v1.1