X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdbi.c;h=19d4b0a6c089c3d9b0ad48445ff27a16718acb07;hb=bbf3f23aee672042cf5405baa01463f70bf5bb9d;hp=b93aa51e39f440cd8cbd3fb1f4646948b67563ba;hpb=958f7776a2daaa1a8664aded0a2c1d717c2f5909;p=collectd.git diff --git a/src/dbi.c b/src/dbi.c index b93aa51e..19d4b0a6 100644 --- a/src/dbi.c +++ b/src/dbi.c @@ -28,7 +28,6 @@ #include "common.h" #include "plugin.h" -#include "configfile.h" #include "utils_db_query.h" #include @@ -391,17 +390,18 @@ static int cdbi_config_add_database (oconfig_item_t *ci) /* {{{ */ } else { - user_data_t ud = { 0 }; char *name = NULL; databases = temp; databases[databases_num] = db; databases_num++; - ud.data = (void *) db; - ud.free_func = NULL; name = ssnprintf_alloc("dbi:%s", db->name); + user_data_t ud = { + .data = db + }; + plugin_register_complex_read (/* group = */ NULL, /* name = */ name ? name : db->name, /* callback = */ cdbi_read_database, @@ -452,14 +452,14 @@ static int cdbi_init (void) /* {{{ */ if (queries_num == 0) { ERROR ("dbi plugin: No blocks have been found. Without them, " - "this plugin can't do anything useful, so we will returns an error."); + "this plugin can't do anything useful, so we will return an error."); return (-1); } if (databases_num == 0) { ERROR ("dbi plugin: No blocks have been found. Without them, " - "this plugin can't do anything useful, so we will returns an error."); + "this plugin can't do anything useful, so we will return an error."); return (-1); }