From: Florian Forster Date: Sat, 28 Mar 2009 08:42:23 +0000 (+0100) Subject: mysql plugin: Make the `Database' option optional again. X-Git-Tag: collectd-4.7.0~76 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=992895b3f46ddaecbcf779cb2977de4c5cc420c7;p=collectd.git mysql plugin: Make the `Database' option optional again. --- diff --git a/src/mysql.c b/src/mysql.c index 0d3cb7f8..a129f40f 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -223,7 +223,6 @@ static int mysql_config (oconfig_item_t *ci) /* {{{ */ return (status); } assert (db->instance != NULL); - db->database = strdup (db->instance); } else { @@ -318,11 +317,6 @@ static int mysql_config (oconfig_item_t *ci) /* {{{ */ db->port); status = -1; } - if (db->database == NULL) - { - ERROR ("mysql plugin: No `Database' configured"); - status = -1; - } break; } /* while (status == 0) */ @@ -332,7 +326,8 @@ static int mysql_config (oconfig_item_t *ci) /* {{{ */ 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 != NULL) ? db->database : ""); memset (&ud, 0, sizeof (ud)); ud.data = (void *) db;