diff options
author | Mohammad Merajul Islam Molla <meraj.enigma@gmail.com> | 2014-06-09 10:02:15 +0530 |
---|---|---|
committer | Amit Kucheria <amit.kucheria@linaro.org> | 2014-06-09 10:12:30 +0530 |
commit | 00def050a7ecf8b9ce431afe875e047632371259 (patch) | |
tree | d85d71b5981e9bb9896d12ea63705e5fe0b59f69 | |
parent | f45331cb495229be0b9fea30996e087d7d192c00 (diff) |
Only trace mode needs root privileges
Signed-off-by: Mohammad Merajul Islam Molla <meraj.enigma@gmail.com>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
-rw-r--r-- | idlestat.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1229,9 +1229,9 @@ int main(int argc, char *argv[], char *const envp[]) if (args <= 0) return 1; - /* We have to manipulate some files only accessible to root */ - if (getuid()) { - fprintf(stderr, "must be root to run the tool\n"); + /* Tracing requires manipulation of some files only accessible to root */ + if ((options.mode == TRACE) && getuid()) { + fprintf(stderr, "must be root to run traces\n"); return -1; } |