Merge branch 'collectd-4.4'
[collectd.git] / src / utils_cmd_putval.c
index 16a09b1..9cbba12 100644 (file)
@@ -32,7 +32,6 @@
        }
 
 static int parse_value (const data_set_t *ds, value_list_t *vl,
-               const char *type,
                FILE *fh, char *buffer)
 {
        char *dummy;
@@ -90,7 +89,7 @@ static int parse_value (const data_set_t *ds, value_list_t *vl,
                return (-1);
        }
 
-       plugin_dispatch_values (type, vl);
+       plugin_dispatch_values (vl);
        return (0);
 } /* int parse_value */
 
@@ -173,6 +172,7 @@ int handle_putval (FILE *fh, char **fields, int fields_num)
 
        sstrncpy (vl.host, hostname, sizeof (vl.host));
        sstrncpy (vl.plugin, plugin, sizeof (vl.plugin));
+       sstrncpy (vl.type, type, sizeof (vl.type));
        if (plugin_instance != NULL)
                sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
        if (type_instance != NULL)
@@ -201,7 +201,7 @@ int handle_putval (FILE *fh, char **fields, int fields_num)
                        /* It's parse_value's job to write an error to `fh'.
                         * This is not the case with `parse_option below.
                         * Neither will write an success message. */
-                       if (parse_value (ds, &vl, type, fh, fields[i]) != 0)
+                       if (parse_value (ds, &vl, fh, fields[i]) != 0)
                                break;
                }
                else if (strchr (fields[i], '=') != NULL)