aboutsummaryrefslogtreecommitdiffstats
path: root/sysfs.c
diff options
context:
space:
mode:
authorPA4WDH2024-08-25 16:57:08 +0200
committerPA4WDH2024-08-25 16:57:08 +0200
commitda347a996939a8fe7277d180d0098094332e63d7 (patch)
treedce4dfcca60fadf10ed464bbc1cde27fc8db0d6b /sysfs.c
parentSmall bugfix in sensor autodetection when -P is used (diff)
downloadcputemp2maxfreq-da347a996939a8fe7277d180d0098094332e63d7.tar.gz
cputemp2maxfreq-da347a996939a8fe7277d180d0098094332e63d7.tar.bz2
cputemp2maxfreq-da347a996939a8fe7277d180d0098094332e63d7.zip
Add -Wall -Werror and fix warnings
Diffstat (limited to 'sysfs.c')
-rw-r--r--sysfs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sysfs.c b/sysfs.c
index dc2b822..d6e4d60 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -3,7 +3,11 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <errno.h>
#include "debug.h"
+#include "cputemp2maxfreq.h"
+
+extern struct s_config config;
int sysfs_read_str(char *sysfs_file,char *buf,size_t bufsize)
{
@@ -62,6 +66,11 @@ int sysfs_write_str(char *sysfs_file,char *value,long int checkdelay)
// Write the data
len=write(sysfs_handle,value,strlen(value));
+ if (len<0)
+ {
+ config.logger("Error %d occoured while writing to sysfs",errno);
+ }
+
close(sysfs_handle);
DEBUG2_SYSFS("Written %zd bytes\n",len);