Fix setting cpu frequence without sufficient privileges

pull/1/head
Slávek Banko 11 years ago
parent d36ef5011e
commit 03857a5540

@ -1083,7 +1083,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;
}

@ -1889,7 +1889,7 @@ void tdepowersave::setSchemeSettings(){
}
// --> set CPU Freq settings
if(hwinfo->supportCPUFreq()) {
if(hwinfo->supportCPUFreq() && hwinfo->isCpuFreqAllowed()) {
hwinfo->setCPUFreq( settings->cpuFreqPolicy, settings->cpuFreqDynamicPerformance);
}
@ -2326,7 +2326,7 @@ void tdepowersave::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