projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of octo@verplant.org:/var/lib/git/collectd
[collectd.git]
/
src
/
battery.c
diff --git
a/src/battery.c
b/src/battery.c
index
74b3344
..
d142982
100644
(file)
--- a/
src/battery.c
+++ b/
src/battery.c
@@
-98,9
+98,8
@@
static void battery_submit (const char *plugin_instance, const char *type, doubl
vl.values = values;
vl.values_len = 1;
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "battery");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "battery", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
@@
-315,7
+314,8
@@
static void get_via_generic_iokit (double *ret_charge,
#endif /* HAVE_IOKIT_IOKITLIB_H */
#if KERNEL_LINUX
#endif /* HAVE_IOKIT_IOKITLIB_H */
#if KERNEL_LINUX
-static int battery_read_acpi (const char *name)
+static int battery_read_acpi (const char *dir, const char *name,
+ void *user_data)
{
double current = INVALID_VALUE;
double voltage = INVALID_VALUE;
{
double current = INVALID_VALUE;
double voltage = INVALID_VALUE;
@@
-506,7
+506,8
@@
static int battery_read (void)
battery_submit ("0", "voltage", voltage);
}
battery_submit ("0", "voltage", voltage);
}
- walk_directory (battery_acpi_dir, battery_read_acpi);
+ walk_directory (battery_acpi_dir, battery_read_acpi,
+ /* user_data = */ NULL);
#endif /* KERNEL_LINUX */
#endif /* KERNEL_LINUX */