aboutsummaryrefslogtreecommitdiffstats
path: root/failsafe.c
diff options
context:
space:
mode:
authorPA4WDH2024-08-24 16:07:11 +0200
committerPA4WDH2024-08-24 16:07:11 +0200
commit66aca8aa35bc0b07c754d9ad95c808e4d91f58f1 (patch)
tree8f051b5cc7660ff596c7ef80c69a9a485016b26c /failsafe.c
parentAdd -k option to keep state on successul exit (diff)
downloadcputemp2maxfreq-66aca8aa35bc0b07c754d9ad95c808e4d91f58f1.tar.gz
cputemp2maxfreq-66aca8aa35bc0b07c754d9ad95c808e4d91f58f1.tar.bz2
cputemp2maxfreq-66aca8aa35bc0b07c754d9ad95c808e4d91f58f1.zip
Add multi-CPU support
Diffstat (limited to 'failsafe.c')
-rw-r--r--failsafe.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/failsafe.c b/failsafe.c
index b723457..c6775ff 100644
--- a/failsafe.c
+++ b/failsafe.c
@@ -5,6 +5,7 @@
#include "cputemp2maxfreq.h"
#include "cpufreq.h"
#include "logger.h"
+#include "cpulist.h"
extern struct s_cpudata cpudata;
extern struct s_config config;
@@ -21,6 +22,7 @@ void failsafe(int code)
if (cpufreq_set_long_int("scaling_max_freq",cpudata.min_freq,100)>0)
{
config.logger("Set scaling frequency to CPU's minimum frequency");
+ cpulist_free();
exit(code);
}
config.logger("Failed to set scaling frequency to CPU's minimum frequency, error: %d (%s)",errno,strerror(errno));
@@ -29,6 +31,7 @@ void failsafe(int code)
if (cpufreq_set_long_int("scaling_max_freq",config.fallback_freq,100)>0)
{
config.logger("Set scaling frequency to fallback frequency");
+ cpulist_free();
exit(code);
}
config.logger("Failed to set scaling frequency to fallback frequency, error: %d (%s)",errno,strerror(errno));
@@ -40,5 +43,6 @@ void failsafe(int code)
config.logger("Keeping current state due to -k option");
}
+ cpulist_free();
exit(code);
}