X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fapache.c;h=b57d08edc447c9005d32fded65b85d00d425b111;hb=51181b899668ad2c232a152d6e5e787c4eb049cc;hp=afdeda4ec2eb02a8e5296546102d5e1bfdf9574a;hpb=3fae5596643f1e361eb18c3d65448f8bc02fdd80;p=collectd.git diff --git a/src/apache.c b/src/apache.c index afdeda4e..b57d08ed 100644 --- a/src/apache.c +++ b/src/apache.c @@ -25,9 +25,9 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" -#include "configfile.h" #include @@ -174,7 +174,6 @@ static size_t apache_header_callback (void *buf, size_t size, size_t nmemb, static int config_add (oconfig_item_t *ci) { apache_t *st; - int i; int status; st = calloc (1, sizeof (*st)); @@ -194,7 +193,7 @@ static int config_add (oconfig_item_t *ci) } assert (st->name != NULL); - for (i = 0; i < ci->children_num; i++) + for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i; @@ -250,7 +249,7 @@ static int config_add (oconfig_item_t *ci) ssnprintf (callback_name, sizeof (callback_name), "apache/%s/%s", (st->host != NULL) ? st->host : hostname_g, - (st->name != NULL) ? st->name : "default"), + (st->name != NULL) ? st->name : "default"); status = plugin_register_complex_read (/* group = */ NULL, /* name = */ callback_name, @@ -271,9 +270,8 @@ static int config_add (oconfig_item_t *ci) static int config (oconfig_item_t *ci) { int status = 0; - int i; - for (i = 0; i < ci->children_num; i++) + for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i; @@ -464,8 +462,7 @@ static void submit_scoreboard (char *buf, apache_t *st) long long response_start = 0LL; long long response_end = 0LL; - int i; - for (i = 0; buf[i] != '\0'; i++) + for (int i = 0; buf[i] != '\0'; i++) { if (buf[i] == '.') open++; else if (buf[i] == '_') waiting++;