diff options
author | Slávek Banko <[email protected]> | 2013-10-06 02:05:56 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2013-10-06 02:05:56 +0200 |
commit | 03857a5540b4b94c8aaf05ab4a97c49f28e7386d (patch) | |
tree | db4d385c3d8f369d8f2c366dea98e9f6ebe42149 | |
parent | d36ef5011e99e9688d6394df9bbadb8457c478e3 (diff) | |
download | tdepowersave-03857a5540b4b94c8aaf05ab4a97c49f28e7386d.tar.gz tdepowersave-03857a5540b4b94c8aaf05ab4a97c49f28e7386d.zip |
Fix setting cpu frequence without sufficient privileges
-rw-r--r-- | src/hardware.cpp | 2 | ||||
-rw-r--r-- | src/tdepowersave.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/hardware.cpp b/src/hardware.cpp index bb4f21f..e3b811a 100644 --- a/src/hardware.cpp +++ b/src/hardware.cpp @@ -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; } diff --git a/src/tdepowersave.cpp b/src/tdepowersave.cpp index 73b569d..c32701d 100644 --- a/src/tdepowersave.cpp +++ b/src/tdepowersave.cpp @@ -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 ); } |