diff options
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); |