You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branches 'pm-domains', 'powercap' and 'pm-tools'
* pm-domains: PM / Domains: Export of_genpd_get_from_provider function * powercap: powercap / RAPL: add IDs for future Xeon CPUs * pm-tools: tools / cpupower: Fix no idle state information return value tools / cpupower: Correctly detect if running as root
This commit is contained in:
@@ -199,7 +199,7 @@ int main(int argc, const char *argv[])
|
||||
}
|
||||
|
||||
get_cpu_info(0, &cpupower_cpu_info);
|
||||
run_as_root = !getuid();
|
||||
run_as_root = !geteuid();
|
||||
if (run_as_root) {
|
||||
ret = uname(&uts);
|
||||
if (!ret && !strcmp(uts.machine, "x86_64") &&
|
||||
|
||||
@@ -361,7 +361,7 @@ unsigned int sysfs_get_idlestate_count(unsigned int cpu)
|
||||
|
||||
snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpuidle");
|
||||
if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode))
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
|
||||
snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/cpuidle/state0", cpu);
|
||||
if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode))
|
||||
|
||||
Reference in New Issue
Block a user