X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fmysql.c;h=40707be364f8e0818decb3fbff5ad527a8f55a85;hp=1396e9541cfe84cd5ed63120e0d0dd63d9c19a1e;hb=6e41c3b1f024d7944e5e8010a87933555c662474;hpb=029b489b237a8785c539f85d4840a49ba6743603 diff --git a/src/mysql.c b/src/mysql.c index 1396e954..40707be3 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -147,8 +147,8 @@ static int mysql_config_database(oconfig_item_t *ci) /* {{{ */ db->timeout = 0; /* trigger a notification, if it's not running */ - db->slave_io_running = 1; - db->slave_sql_running = 1; + db->slave_io_running = true; + db->slave_sql_running = true; status = cf_util_get_string(ci, &db->instance); if (status != 0) { @@ -268,7 +268,7 @@ static MYSQL *getconnection(mysql_database_t *db) { WARNING("mysql plugin: Lost connection to instance \"%s\": %s", db->instance, mysql_error(db->con)); } - db->is_connected = 0; + db->is_connected = false; /* Close the old connection before initializing a new one. */ if (db->con != NULL) { @@ -305,7 +305,7 @@ static MYSQL *getconnection(mysql_database_t *db) { mysql_get_host_info(db->con), (cipher != NULL) ? cipher : "", mysql_get_server_info(db->con), mysql_get_proto_info(db->con)); - db->is_connected = 1; + db->is_connected = true; return db->con; } /* static MYSQL *getconnection (mysql_database_t *db) */ @@ -503,14 +503,14 @@ static int mysql_read_slave_stats(mysql_database_t *db, MYSQL *con) { snprintf(n.message, sizeof(n.message), "slave I/O thread not started or not connected to master"); plugin_dispatch_notification(&n); - db->slave_io_running = 0; + db->slave_io_running = false; } else if (((io != NULL) && (strcasecmp(io, "yes") == 0)) && (!db->slave_io_running)) { n.severity = NOTIF_OKAY; snprintf(n.message, sizeof(n.message), "slave I/O thread started and connected to master"); plugin_dispatch_notification(&n); - db->slave_io_running = 1; + db->slave_io_running = true; } if (((sql == NULL) || (strcasecmp(sql, "yes") != 0)) && @@ -518,13 +518,13 @@ static int mysql_read_slave_stats(mysql_database_t *db, MYSQL *con) { n.severity = NOTIF_WARNING; snprintf(n.message, sizeof(n.message), "slave SQL thread not started"); plugin_dispatch_notification(&n); - db->slave_sql_running = 0; + db->slave_sql_running = false; } else if (((sql != NULL) && (strcasecmp(sql, "yes") == 0)) && (!db->slave_sql_running)) { n.severity = NOTIF_OKAY; snprintf(n.message, sizeof(n.message), "slave SQL thread started"); plugin_dispatch_notification(&n); - db->slave_sql_running = 1; + db->slave_sql_running = true; } }