From c1203952f64c61b2451dc9107810ba450c3ea675 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 27 Apr 2014 14:24:39 +1200 Subject: Added sudo to cmd line for trayfreq-set --- trayfreq_set/trayfreq_set_interface.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'trayfreq_set') diff --git a/trayfreq_set/trayfreq_set_interface.c b/trayfreq_set/trayfreq_set_interface.c index 040513a..6dc6b14 100644 --- a/trayfreq_set/trayfreq_set_interface.c +++ b/trayfreq_set/trayfreq_set_interface.c @@ -24,23 +24,14 @@ void si_gov(char* gov, int core) { - char corestr[4]; - sprintf(corestr, "%i", core); - - char* cmd = g_strconcat("/usr/bin/trayfreq-set -g ", gov, " -c ", corestr, NULL); + char cmd[256]; + sprintf(cmd, "/usr/bin/sudo trayfreq-set -g %s -c %i",gov,core); system(cmd); - g_free(cmd); } void si_freq(int freq, int core) { - char corestr[4]; - char freqstr[13]; - - sprintf(corestr, "%i", core); - sprintf(freqstr, "%i", freq); - - char* cmd = g_strconcat("/usr/bin/trayfreq-set -f ", freqstr, " -c ", corestr, NULL); + char cmd[256]; + sprintf(cmd, "/usr/bin/sudo trayfreq-set -f %i -c %i",freq,core); system(cmd); - g_free(cmd); -} \ No newline at end of file +} -- cgit v1.1