diff options
author | PA4WDH | 2024-08-25 16:57:08 +0200 |
---|---|---|
committer | PA4WDH | 2024-08-25 16:57:08 +0200 |
commit | da347a996939a8fe7277d180d0098094332e63d7 (patch) | |
tree | dce4dfcca60fadf10ed464bbc1cde27fc8db0d6b /sysfs.c | |
parent | Small bugfix in sensor autodetection when -P is used (diff) | |
download | cputemp2maxfreq-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.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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); |