From: Florian Forster Date: Fri, 3 Jul 2015 08:44:35 +0000 (+0200) Subject: mqtt plugin: Use the "name" argument for the callback name. X-Git-Tag: collectd-5.6.0~637^2~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=82bd9cf8f273d70ec11165c783da35cbc577aaed;p=collectd.git mqtt plugin: Use the "name" argument for the callback name. --- diff --git a/src/mqtt.c b/src/mqtt.c index 98b1751d..acc514c5 100644 --- a/src/mqtt.c +++ b/src/mqtt.c @@ -473,6 +473,7 @@ static int mqtt_write (const data_set_t *ds, const value_list_t *vl, static int mqtt_config_publisher (oconfig_item_t *ci) { mqtt_client_conf_t *conf; + char cb_name[1024]; user_data_t user_data; int status; int i; @@ -538,10 +539,11 @@ static int mqtt_config_publisher (oconfig_item_t *ci) ERROR ("mqtt plugin: Unknown config option: %s", child->key); } + ssnprintf (cb_name, sizeof (cb_name), "mqtt/%s", conf->name); memset (&user_data, 0, sizeof (user_data)); user_data.data = conf; - plugin_register_write ("mqtt", mqtt_write, &user_data); + plugin_register_write (cb_name, mqtt_write, &user_data); return (0); } /* mqtt_config_publisher */