aboutsummaryrefslogtreecommitdiffstats
path: root/sysfs.c
diff options
context:
space:
mode:
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);