summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-10-06 02:07:28 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-10-06 02:07:28 +0200
commit055857b20162e0722821ae6dc1f98af4bfd6a273 (patch)
tree1898709fb3d83f646089300784c222066f284bc0 /src
parent95b83ac28d43228cbcc6864e483c4f9f884275f4 (diff)
downloadkpowersave-055857b20162e0722821ae6dc1f98af4bfd6a273.tar.gz
kpowersave-055857b20162e0722821ae6dc1f98af4bfd6a273.zip
Fix setting cpu frequence without sufficient privileges
Diffstat (limited to 'src')
-rw-r--r--src/hardware.cpp2
-rw-r--r--src/kpowersave.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/hardware.cpp b/src/hardware.cpp
index 756eac0..4d688f5 100644
--- a/src/hardware.cpp
+++ b/src/hardware.cpp
@@ -1127,7 +1127,7 @@ bool HardwareInfo::setCPUFreq ( cpufreq_type cpufreq, int limit ) {
}
if (cpuFreqAllowed == 0) {
- kdError() << "Could not set CPU Freq, this not the needed privileges." << endl;
+ kdError() << "Could not set CPU Freq - insufficient privileges." << endl;
return false;
}
diff --git a/src/kpowersave.cpp b/src/kpowersave.cpp
index c814375..b73420e 100644
--- a/src/kpowersave.cpp
+++ b/src/kpowersave.cpp
@@ -1861,7 +1861,7 @@ void kpowersave::setSchemeSettings(){
}
// --> set CPU Freq settings
- if(hwinfo->supportCPUFreq()) {
+ if(hwinfo->supportCPUFreq() && hwinfo->isCpuFreqAllowed()) {
hwinfo->setCPUFreq( settings->cpuFreqPolicy, settings->cpuFreqDynamicPerformance);
}
@@ -2250,7 +2250,7 @@ void kpowersave::handleResumeSignal() {
setAutoDimm(true);
// reset the CPU Freq Policy ... for more see https://bugzilla.novell.com/show_bug.cgi?id=223164
- if(hwinfo->supportCPUFreq()) {
+ if(hwinfo->supportCPUFreq() && hwinfo->isCpuFreqAllowed()) {
hwinfo->setCPUFreq( settings->cpuFreqPolicy, settings->cpuFreqDynamicPerformance );
}