diff options
author | PA4WDH | 2024-08-24 16:07:11 +0200 |
---|---|---|
committer | PA4WDH | 2024-08-24 16:07:11 +0200 |
commit | 66aca8aa35bc0b07c754d9ad95c808e4d91f58f1 (patch) | |
tree | 8f051b5cc7660ff596c7ef80c69a9a485016b26c /failsafe.c | |
parent | Add -k option to keep state on successul exit (diff) | |
download | cputemp2maxfreq-66aca8aa35bc0b07c754d9ad95c808e4d91f58f1.tar.gz cputemp2maxfreq-66aca8aa35bc0b07c754d9ad95c808e4d91f58f1.tar.bz2 cputemp2maxfreq-66aca8aa35bc0b07c754d9ad95c808e4d91f58f1.zip |
Add multi-CPU support
Diffstat (limited to 'failsafe.c')
-rw-r--r-- | failsafe.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); } |