Fix setting cpu frequence without sufficient privileges

pull/1/head
Slávek Banko 11 years ago
parent 95b83ac28d
commit 055857b201

@ -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;
}

@ -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 );
}

Loading…
Cancel
Save