From 91b78cb1f60430a9f2e87c27af26c883f95de754 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 2 May 2014 11:22:22 +1200 Subject: Done --- trayfreq_set/trayfreq_set_interface.c | 15 ++++++++++++--- trayfreq_set/trayfreq_set_interface.h | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'trayfreq_set') diff --git a/trayfreq_set/trayfreq_set_interface.c b/trayfreq_set/trayfreq_set_interface.c index 490d50c..3e26112 100644 --- a/trayfreq_set/trayfreq_set_interface.c +++ b/trayfreq_set/trayfreq_set_interface.c @@ -18,20 +18,29 @@ #include "trayfreq_set_interface.h" -#include #include #include void si_gov(char* gov, int core) { char cmd[256]; - sprintf(cmd, "/usr/bin/trayfreq-set -g %s -c %i",gov,core); + if (_DEFAULT_USE_SUDO) + { + sprintf(cmd, "sudo trayfreq-set -g %s -c %i",gov,core); + } else { + sprintf(cmd, "trayfreq-set -g %s -c %i",gov,core); + } system(cmd); } void si_freq(int freq, int core) { char cmd[256]; - sprintf(cmd, "/usr/bin/trayfreq-set -f %i -c %i",freq,core); + if (_DEFAULT_USE_SUDO) + { + sprintf(cmd, "sudo trayfreq-set -f %i -c %i",freq,core); + } else { + sprintf(cmd, "trayfreq-set -f %i -c %i",freq,core); + } system(cmd); } diff --git a/trayfreq_set/trayfreq_set_interface.h b/trayfreq_set/trayfreq_set_interface.h index bdbf652..c5681e4 100644 --- a/trayfreq_set/trayfreq_set_interface.h +++ b/trayfreq_set/trayfreq_set_interface.h @@ -19,6 +19,8 @@ #ifndef TRAYFREQ_SET_INTERFACE_H #define TRAYFREQ_SET_INTERFACE_H +#include "../defaults.h" + void si_gov(char* gov, int core); void si_freq(int freq, int core); -- cgit v1.1