summary refs log tree commit diff stats
path: root/plugins/sysinfo/hwmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/sysinfo/hwmon.c')
-rw-r--r--plugins/sysinfo/hwmon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/sysinfo/hwmon.c b/plugins/sysinfo/hwmon.c
index 389244ac..e562458f 100644
--- a/plugins/sysinfo/hwmon.c
+++ b/plugins/sysinfo/hwmon.c
@@ -53,8 +53,9 @@ void get_hwmon_chip_name(char *name)
 void get_hwmon_temp(unsigned int *value, unsigned int *sensor)
 {
 	char buffer[bsize];
+	FILE *fp;
 	snprintf(buffer, bsize, "/sys/class/hwmon/hwmon0/device/temp%i_input", *sensor);
-	FILE *fp = fopen(buffer, "r");
+	fp = fopen(buffer, "r");
 	if(fp != NULL) {
 		if(fgets(buffer, bsize, fp) != NULL)
 			*value = atoi(buffer);