From d1e3b814cbb9c08ce5a626445cd2930b13a9893c Mon Sep 17 00:00:00 2001 From: David Date: Wed, 4 Jun 2014 19:54:12 +1200 Subject: Moved away from manual setting of sudo-ness --- trayfreq_set_interface.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'trayfreq_set_interface.c') diff --git a/trayfreq_set_interface.c b/trayfreq_set_interface.c index d16c160..a2e20c8 100644 --- a/trayfreq_set_interface.c +++ b/trayfreq_set_interface.c @@ -18,33 +18,33 @@ #include "trayfreq_set_interface.h" -#include "debug.h" -#include "defaults.h" +#include "common.h" #include #include +#include void si_gov(char* gov, int core) { char cmd[256]; - if (_DEFAULT_USE_SUDO) + if (getuid() != ROOT_UID) { sprintf(cmd, SUDO" "TRAYFREQ_SET" -g %s -c %i",gov,core); } else { sprintf(cmd, TRAYFREQ_SET" -g %s -c %i",gov,core); } - debug("Running '%s'\n",cmd); + info("Running '%s'\n",cmd); system(cmd); } void si_freq(int freq, int core) { char cmd[256]; - if (_DEFAULT_USE_SUDO) + if (getuid() != ROOT_UID) { sprintf(cmd, SUDO" "TRAYFREQ_SET" -f %i -c %i",freq,core); } else { sprintf(cmd, TRAYFREQ_SET" -f %i -c %i",freq,core); } - debug("Running '%s'\n",cmd); + info("Running '%s'\n",cmd); system(cmd); } -- cgit v1.1