X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fhddtemp.c;h=8213e9724525886a908f7e94966173e1b5d20150;hb=83d2ff540ffaa5ca8cf3f37ea428d4b4b8c8d875;hp=e7b4d8a10d63aefcc153bb9757ca770ec2e1504d;hpb=cd5c60931ef73c6c34be6dcf58538b069be17c58;p=collectd.git diff --git a/src/hddtemp.c b/src/hddtemp.c index e7b4d8a1..8213e972 100644 --- a/src/hddtemp.c +++ b/src/hddtemp.c @@ -30,6 +30,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include "configfile.h" @@ -88,7 +89,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; @@ -118,7 +119,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, @@ -249,7 +250,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) @@ -270,7 +270,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;