From 8afc7e0da30654711884328c2d6b09fc3370c8f7 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 12 Jun 2008 10:23:49 +0200 Subject: [PATCH] thermal plugin: Updated the submit function to the new infrastructure. --- src/thermal.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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) -- 2.11.0