From: Florian Forster Date: Thu, 12 Jun 2008 08:23:49 +0000 (+0200) Subject: thermal plugin: Updated the submit function to the new infrastructure. X-Git-Tag: collectd-4.5.0~118 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8afc7e0da30654711884328c2d6b09fc3370c8f7;p=collectd.git thermal plugin: Updated the submit function to the new infrastructure. --- diff --git a/src/thermal.c b/src/thermal.c index a6ebe4eb..f7f2a59d 100644 --- a/src/thermal.c +++ b/src/thermal.c @@ -42,18 +42,23 @@ enum dev_type { COOLING_DEV }; -static void thermal_submit (const char *plugin_instance, enum dev_type dt, double value) +static void thermal_submit (const char *plugin_instance, enum dev_type dt, + gauge_t value) { - value_list_t vl = dt == TEMP ? vl_temp_template : vl_state_template; + value_list_t vl = (dt == TEMP) ? vl_temp_template : vl_state_template; value_t vt; vt.gauge = value; vl.values = &vt; vl.time = time (NULL); - sstrncpy (vl.plugin_instance, plugin_instance, sizeof(vl.plugin_instance)); + sstrncpy (vl.plugin, "thermal", sizeof(vl.plugin)); + sstrncpy (vl.plugin_instance, plugin_instance, + sizeof(vl.plugin_instance)); + sstrncpy (vl.type, (dt == TEMP) ? "temperature" : "gauge", + sizeof (vl.type)); - plugin_dispatch_values (dt == TEMP ? "temperature" : "gauge", &vl); + plugin_dispatch_values (&vl); } static int read_file_contents (const char *filename, char *buf, int bufsize)