projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1856 from rubenk/snmp-dont-dispatch-values-with-empty-type-instance
[collectd.git]
/
src
/
powerdns.c
diff --git
a/src/powerdns.c
b/src/powerdns.c
index
958a341
..
e215a8c
100644
(file)
--- a/
src/powerdns.c
+++ b/
src/powerdns.c
@@
-631,8
+631,6
@@
static int powerdns_read_server (list_item_t *item) /* {{{ */
saveptr = NULL;
while ((key = strtok_r (dummy, ",", &saveptr)) != NULL)
{
saveptr = NULL;
while ((key = strtok_r (dummy, ",", &saveptr)) != NULL)
{
- int i;
-
dummy = NULL;
value = strchr (key, '=');
dummy = NULL;
value = strchr (key, '=');
@@
-646,6
+644,7
@@
static int powerdns_read_server (list_item_t *item) /* {{{ */
continue;
/* Check if this item was requested. */
continue;
/* Check if this item was requested. */
+ int i;
for (i = 0; i < fields_num; i++)
if (strcasecmp (key, fields[i]) == 0)
break;
for (i = 0; i < fields_num; i++)
if (strcasecmp (key, fields[i]) == 0)
break;
@@
-781,7
+780,6
@@
static int powerdns_read_recursor (list_item_t *item) /* {{{ */
static int powerdns_config_add_collect (list_item_t *li, /* {{{ */
oconfig_item_t *ci)
{
static int powerdns_config_add_collect (list_item_t *li, /* {{{ */
oconfig_item_t *ci)
{
- int i;
char **temp;
if (ci->values_num < 1)
char **temp;
if (ci->values_num < 1)
@@
-791,7
+789,7
@@
static int powerdns_config_add_collect (list_item_t *li, /* {{{ */
return (-1);
}
return (-1);
}
- for (i = 0; i < ci->values_num; i++)
+ for (i
nt i
= 0; i < ci->values_num; i++)
if (ci->values[i].type != OCONFIG_TYPE_STRING)
{
WARNING ("powerdns plugin: Only string arguments are allowed to "
if (ci->values[i].type != OCONFIG_TYPE_STRING)
{
WARNING ("powerdns plugin: Only string arguments are allowed to "
@@
-808,7
+806,7
@@
static int powerdns_config_add_collect (list_item_t *li, /* {{{ */
}
li->fields = temp;
}
li->fields = temp;
- for (i = 0; i < ci->values_num; i++)
+ for (i
nt i
= 0; i < ci->values_num; i++)
{
li->fields[li->fields_num] = strdup (ci->values[i].value.string);
if (li->fields[li->fields_num] == NULL)
{
li->fields[li->fields_num] = strdup (ci->values[i].value.string);
if (li->fields[li->fields_num] == NULL)
@@
-831,7
+829,6
@@
static int powerdns_config_add_server (oconfig_item_t *ci) /* {{{ */
list_item_t *item;
int status;
list_item_t *item;
int status;
- int i;
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING))
{
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING))
{
@@
-880,7
+877,7
@@
static int powerdns_config_add_server (oconfig_item_t *ci) /* {{{ */
}
status = 0;
}
status = 0;
- for (i = 0; i < ci->children_num; i++)
+ for (i
nt i
= 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
{
oconfig_item_t *option = ci->children + i;
@@
-940,8
+937,6
@@
static int powerdns_config_add_server (oconfig_item_t *ci) /* {{{ */
static int powerdns_config (oconfig_item_t *ci) /* {{{ */
{
static int powerdns_config (oconfig_item_t *ci) /* {{{ */
{
- int i;
-
DEBUG ("powerdns plugin: powerdns_config (ci = %p);", (void *) ci);
if (list == NULL)
DEBUG ("powerdns plugin: powerdns_config (ci = %p);", (void *) ci);
if (list == NULL)
@@
-955,7
+950,7
@@
static int powerdns_config (oconfig_item_t *ci) /* {{{ */
}
}
}
}
- for (i = 0; i < ci->children_num; i++)
+ for (i
nt i
= 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
{
oconfig_item_t *option = ci->children + i;
@@
-988,9
+983,7
@@
static int powerdns_config (oconfig_item_t *ci) /* {{{ */
static int powerdns_read (void)
{
static int powerdns_read (void)
{
- llentry_t *e;
-
- for (e = llist_head (list); e != NULL; e = e->next)
+ for (llentry_t *e = llist_head (list); e != NULL; e = e->next)
{
list_item_t *item = e->value;
item->func (item);
{
list_item_t *item = e->value;
item->func (item);
@@
-1001,12
+994,10
@@
static int powerdns_read (void)
static int powerdns_shutdown (void)
{
static int powerdns_shutdown (void)
{
- llentry_t *e;
-
if (list == NULL)
return (0);
if (list == NULL)
return (0);
- for (e = llist_head (list); e != NULL; e = e->next)
+ for (
llentry_t *
e = llist_head (list); e != NULL; e = e->next)
{
list_item_t *item = (list_item_t *) e->value;
e->value = NULL;
{
list_item_t *item = (list_item_t *) e->value;
e->value = NULL;