X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnut.c;h=b5c6b41b6522142aba73716ed36b5a05e4886608;hb=d3ba4d04f6c5d22ba97ea81cdca2e2acd04dfec1;hp=a033e2f668503520eb8860fc8bf54f2354d803d3;hpb=73a6f82a63747f088352a61e201beac2d185b2ac;p=collectd.git diff --git a/src/nut.c b/src/nut.c index a033e2f6..b5c6b41b 100644 --- a/src/nut.c +++ b/src/nut.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" @@ -247,7 +248,6 @@ static int nut_read_one (nut_ups_t *ups) static int nut_read (void) { - nut_ups_t *ups; int success = 0; pthread_mutex_lock (&read_lock); @@ -258,7 +258,7 @@ static int nut_read (void) if (success != 0) return (0); - for (ups = upslist_head; ups != NULL; ups = ups->next) + for (nut_ups_t *ups = upslist_head; ups != NULL; ups = ups->next) if (nut_read_one (ups) == 0) success++;