diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/power/cpupower/utils/cpupower.c | 2 | ||||
-rw-r--r-- | tools/power/cpupower/utils/helpers/sysfs.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/power/cpupower/utils/cpupower.c b/tools/power/cpupower/utils/cpupower.c index 7cdcf88659c7..9ea914378985 100644 --- a/tools/power/cpupower/utils/cpupower.c +++ b/tools/power/cpupower/utils/cpupower.c | |||
@@ -199,7 +199,7 @@ int main(int argc, const char *argv[]) | |||
199 | } | 199 | } |
200 | 200 | ||
201 | get_cpu_info(0, &cpupower_cpu_info); | 201 | get_cpu_info(0, &cpupower_cpu_info); |
202 | run_as_root = !getuid(); | 202 | run_as_root = !geteuid(); |
203 | if (run_as_root) { | 203 | if (run_as_root) { |
204 | ret = uname(&uts); | 204 | ret = uname(&uts); |
205 | if (!ret && !strcmp(uts.machine, "x86_64") && | 205 | if (!ret && !strcmp(uts.machine, "x86_64") && |
diff --git a/tools/power/cpupower/utils/helpers/sysfs.c b/tools/power/cpupower/utils/helpers/sysfs.c index 09afe5d87f2b..4e8fe2c7b054 100644 --- a/tools/power/cpupower/utils/helpers/sysfs.c +++ b/tools/power/cpupower/utils/helpers/sysfs.c | |||
@@ -361,7 +361,7 @@ unsigned int sysfs_get_idlestate_count(unsigned int cpu) | |||
361 | 361 | ||
362 | snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpuidle"); | 362 | snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpuidle"); |
363 | if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) | 363 | if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) |
364 | return -ENODEV; | 364 | return 0; |
365 | 365 | ||
366 | snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/cpuidle/state0", cpu); | 366 | snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/cpuidle/state0", cpu); |
367 | if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) | 367 | if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) |