X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnut.c;h=b5c6b41b6522142aba73716ed36b5a05e4886608;hb=da612fa9c6a3343b43789569d64197d7c690be52;hp=a033e2f668503520eb8860fc8bf54f2354d803d3;hpb=21ab7512825cf8177d5eee5101344b45d0854610;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++;