projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8b72c26
)
mysql plugin: Use "mysql-$db" when registering a read callback.
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Wed, 18 Mar 2009 17:22:36 +0000
(18:22 +0100)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Wed, 18 Mar 2009 17:22:36 +0000
(18:22 +0100)
src/mysql.c
patch
|
blob
|
history
diff --git
a/src/mysql.c
b/src/mysql.c
index
d936478
..
5d624a6
100644
(file)
--- a/
src/mysql.c
+++ b/
src/mysql.c
@@
-274,6
+274,7
@@
static int mysql_config (oconfig_item_t *ci) /* {{{ */
if (status == 0)
{
user_data_t ud;
if (status == 0)
{
user_data_t ud;
+ char cb_name[DATA_MAX_NAME_LEN];
DEBUG ("mysql plugin: Registering new read callback: %s", db->database);
DEBUG ("mysql plugin: Registering new read callback: %s", db->database);
@@
-281,7
+282,13
@@
static int mysql_config (oconfig_item_t *ci) /* {{{ */
ud.data = (void *) db;
ud.free_func = mysql_database_free;
ud.data = (void *) db;
ud.free_func = mysql_database_free;
- plugin_register_complex_read (db->database, mysql_read,
+ if (db->database != NULL)
+ ssnprintf (cb_name, sizeof (cb_name), "mysql-%s",
+ db->database);
+ else
+ sstrncpy (cb_name, "mysql", sizeof (cb_name));
+
+ plugin_register_complex_read (cb_name, mysql_read,
/* interval = */ NULL, &ud);
}
else
/* interval = */ NULL, &ud);
}
else