aboutsummaryrefslogtreecommitdiffstats
path: root/failsafe.c
diff options
context:
space:
mode:
authorPA4WDH2023-05-24 12:57:25 +0200
committerPA4WDH2023-05-24 12:57:25 +0200
commit16fb812a46d0e8cde432b58f7dbf6fce147eb89f (patch)
tree9e019f98e515cb21e6c38ff487a82fe375675991 /failsafe.c
parentDetect program name from argv[0] (diff)
downloadcputemp2maxfreq-16fb812a46d0e8cde432b58f7dbf6fce147eb89f.tar.gz
cputemp2maxfreq-16fb812a46d0e8cde432b58f7dbf6fce147eb89f.tar.bz2
cputemp2maxfreq-16fb812a46d0e8cde432b58f7dbf6fce147eb89f.zip
Add CSV logging
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 f0c0b3e..59d9d15 100644
--- a/failsafe.c
+++ b/failsafe.c
@@ -4,12 +4,16 @@
#include <stdio.h>
#include "cputemp2maxfreq.h"
#include "cpufreq.h"
+#include "logger.h"
extern struct s_cpudata cpudata;
extern struct s_config config;
void failsafe(int code)
{
+// Close CSV log if used
+ if (config.csvfile!=NULL) csvlog_close();
+
// First try to set the CPU to it's minimum frequency
if (cpufreq_set_long_int("scaling_max_freq",cpudata.min_freq,100)>0)
{