X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Foracle.c;h=3f28110f8caf94fb014be5f58bed929e7336ff5d;hb=6378ec288f34ff250b2971a1452338a2b34c240a;hp=38f08f2b91b6a8e7842b3f46770e7e788c9c6f74;hpb=fc0ff427d748c12348bc6225e96f9cf615c77bce;p=collectd.git diff --git a/src/oracle.c b/src/oracle.c index 38f08f2b..3f28110f 100644 --- a/src/oracle.c +++ b/src/oracle.c @@ -47,9 +47,9 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" -#include "utils_db_query.h" +#include "utils/common/common.h" +#include "utils/db_query/db_query.h" #include @@ -107,7 +107,7 @@ static void o_report_error(const char *where, /* {{{ */ status = OCIErrorGet(eh, (ub4)record_number, /* sqlstate = */ NULL, &error_code, (text *)&buffer[0], (ub4)sizeof(buffer), OCI_HTYPE_ERROR); - buffer[sizeof(buffer) - 1] = 0; + buffer[sizeof(buffer) - 1] = '\0'; if (status == OCI_NO_DATA) return; @@ -247,9 +247,7 @@ static int o_config_add_database(oconfig_item_t *ci) /* {{{ */ } /* while (status == 0) */ while ((status == 0) && (db->queries_num > 0)) { - db->q_prep_areas = (udb_query_preparation_area_t **)calloc( - db->queries_num, sizeof(*db->q_prep_areas)); - + db->q_prep_areas = calloc(db->queries_num, sizeof(*db->q_prep_areas)); if (db->q_prep_areas == NULL) { WARNING("oracle plugin: calloc failed"); status = -1; @@ -550,8 +548,7 @@ static int o_read_database_query(o_database_t *db, /* {{{ */ status = udb_query_prepare_result( q, prep_area, (db->host != NULL) ? db->host : hostname_g, /* plugin = */ (db->plugin_name != NULL) ? db->plugin_name : "oracle", - db->name, column_names, column_num, - /* interval = */ 0); + db->name, column_names, column_num); if (status != 0) { ERROR("oracle plugin: o_read_database_query (%s, %s): " "udb_query_prepare_result failed.", @@ -583,7 +580,7 @@ static int o_read_database_query(o_database_t *db, /* {{{ */ } } /* }}} while (42) */ - udb_query_finish_result (q, prep_area); + udb_query_finish_result(q, prep_area); /* DEBUG ("oracle plugin: o_read_database_query: This statement succeeded: * %s", q->statement); */