aboutsummaryrefslogtreecommitdiffstats
path: root/cputemp2maxfreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'cputemp2maxfreq.c')
-rw-r--r--cputemp2maxfreq.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/cputemp2maxfreq.c b/cputemp2maxfreq.c
index b023b79..aabb99f 100644
--- a/cputemp2maxfreq.c
+++ b/cputemp2maxfreq.c
@@ -56,7 +56,6 @@ int main(int argc,char **argv)
{
printf("Invalid poll interval, range is %d-%d\n",VALID_INTERVAL_MIN,VALID_INTERVAL_MAX);
exit(1);
-
}
// Get and validate CPU data
@@ -79,7 +78,7 @@ int main(int argc,char **argv)
exit(1);
}
-// Modify fallback frequency is needed
+// Modify fallback frequency if needed
if (config.fallback_freq<cpudata.min_freq)
{
printf("Fallback frequency is lower than CPU's minimum frequency, setting to %ld.\n",cpudata.min_freq);
@@ -92,12 +91,15 @@ int main(int argc,char **argv)
}
// Set the governor
- if (cpufreq_set_str("scaling_governor",config.governor,0)<0)
+ if (strcmp(config.governor,"keep")!=0)
{
- printf("Failed to set governor, error %d (%s).\n",errno,strerror(errno));
+ if (cpufreq_set_str("scaling_governor",config.governor,0)<0)
+ {
+ printf("Failed to set governor, error %d (%s).\n",errno,strerror(errno));
// We failed to set the governor, call the failsafe
- failsafe(1);
+ failsafe(1);
+ }
}
// Set signal handlers