aboutsummaryrefslogtreecommitdiff
path: root/freq_tray/getcore.c
diff options
context:
space:
mode:
authorDavid <dbphillipsnz@gmail.com>2014-05-01 12:33:34 +1200
committerDavid <dbphillipsnz@gmail.com>2014-05-01 12:33:34 +1200
commitc6a855363bfc59fbe197bba73bf64b5d920946a1 (patch)
tree4233a6c01283b4bb718d62dec240f33845aae7b1 /freq_tray/getcore.c
parentfe30fcc86801beec76acf219ad339afcbec36dff (diff)
downloadparamano-c6a855363bfc59fbe197bba73bf64b5d920946a1.tar.xz
Completed debug stuff
Diffstat (limited to 'freq_tray/getcore.c')
-rw-r--r--freq_tray/getcore.c9
1 files changed, 5 insertions, 4 deletions
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 <stdlib.h>
#include <glib.h>
-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);
}