X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fhddtemp.c;h=865ea8614afda35cee5993eeec8cf61e86c6f8b6;hb=7dcf9ab7675fe91d1bd74998f55031bc3b0480c0;hp=2b481f51cf3cfebf0a215cebe300c57120c01f61;hpb=063a5e75b36173e89ffa18d32d47509f6ef968ec;p=collectd.git diff --git a/src/hddtemp.c b/src/hddtemp.c index 2b481f51..865ea861 100644 --- a/src/hddtemp.c +++ b/src/hddtemp.c @@ -33,7 +33,6 @@ #include "common.h" #include "plugin.h" -#include "configfile.h" # include # include @@ -89,7 +88,7 @@ static int hddtemp_query_daemon (char *buffer, int buffer_size) const char *host; const char *port; - struct addrinfo *ai_list, *ai_ptr; + struct addrinfo *ai_list; int ai_return; host = hddtemp_host; @@ -119,7 +118,7 @@ static int hddtemp_query_daemon (char *buffer, int buffer_size) } fd = -1; - for (ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next) + for (struct addrinfo *ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next) { /* create our socket descriptor */ fd = socket (ai_ptr->ai_family, ai_ptr->ai_socktype, @@ -250,7 +249,6 @@ static int hddtemp_read (void) char *saveptr; int num_fields; int num_disks; - int i; /* get data from daemon */ if (hddtemp_query_daemon (buf, sizeof (buf)) < 0) @@ -271,7 +269,7 @@ static int hddtemp_read (void) num_disks = num_fields / 4; - for (i = 0; i < num_disks; i++) + for (int i = 0; i < num_disks; i++) { char *name; double temperature;