diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-07-17 11:25:15 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-07-17 23:39:53 +0200 |
commit | b09501019dd567fb4c1044c4e8f5ec2cbf62db59 (patch) | |
tree | 275f351ee8f43618d3ad472e314083f524b6effc | |
parent | 6eda3f65990ac115e6f09bdebc2853bf7294e24b (diff) | |
download | cpufrequtils-b09501019dd567fb4c1044c4e8f5ec2cbf62db59.tar.gz |
libcpufreq: fix proc interface
libcpufreq falls back to the proc interface for 2.4 kernels, but that
didn't work properly in cpufrequtils-004.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r-- | lib/proc.c | 2 | ||||
-rw-r--r-- | lib/sysfs.c | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -53,7 +53,7 @@ static int readout_proc_cpufreq(unsigned int cpu, unsigned long *min, unsigned l if (cpu_read != cpu) continue; - if ((tmp2 < tmp1) || (tmp2 > 100) || (max < min)) { + if ((tmp2 < tmp1) || (tmp2 > 100) || (*max < *min)) { ret = -ENOSYS; goto error; } diff --git a/lib/sysfs.c b/lib/sysfs.c index 6bae2ba..e83d318 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -196,9 +196,9 @@ int sysfs_cpu_exists(unsigned int cpu) snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/", cpu); if ( stat(file, &statbuf) != 0 ) - return 1; + return -ENOSYS; - return 1 - S_ISDIR(statbuf.st_mode); + return S_ISDIR(statbuf.st_mode) ? 0 : -ENOSYS; } |