vt.gauge = value;
vl.values = &vt;
- vl.time = time (NULL);
sstrncpy (vl.plugin, "thermal", sizeof(vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof(vl.plugin_instance));
plugin_dispatch_values (&vl);
}
-static int read_file_contents (const char *filename, char *buf, int bufsize)
-{
- FILE *fh;
- int n;
-
- if ((fh = fopen (filename, "r")) == NULL)
- return -1;
-
- n = fread(buf, 1, bufsize, fh);
- fclose(fh);
-
- return n;
-}
-
-static int thermal_sysfs_device_read (const char *name)
+static int thermal_sysfs_device_read (const char *dir, const char *name,
+ void *user_data)
{
char filename[256];
char data[1024];
return ok ? 0 : -1;
}
-static int thermal_procfs_device_read (const char *name)
+static int thermal_procfs_device_read (const char *dir, const char *name,
+ void *user_data)
{
const char str_temp[] = "temperature:";
char filename[256];
static int thermal_sysfs_read (void)
{
- return walk_directory (dirname_sysfs, thermal_sysfs_device_read);
+ return walk_directory (dirname_sysfs, thermal_sysfs_device_read,
+ /* user_data = */ NULL);
}
static int thermal_procfs_read (void)
{
- return walk_directory (dirname_procfs, thermal_procfs_device_read);
+ return walk_directory (dirname_procfs, thermal_procfs_device_read,
+ /* user_data = */ NULL);
}
static int thermal_init (void)