diff options
Diffstat (limited to 'components/cpu.c')
-rw-r--r-- | components/cpu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/cpu.c b/components/cpu.c index 254f047..28e9a45 100644 --- a/components/cpu.c +++ b/components/cpu.c @@ -7,16 +7,16 @@ #include "../slstatus.h" #if defined(__linux__) + #define CPU_FREQ "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" + const char * cpu_freq(const char *unused) { uintmax_t freq; /* in kHz */ - if (pscanf("/sys/devices/system/cpu/cpu0/cpufreq/" - "scaling_cur_freq", "%ju", &freq) != 1) { + if (pscanf(CPU_FREQ, "%ju", &freq) != 1) return NULL; - } return fmt_human(freq * 1000, 1000); } |