**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "configfile.h"
const char *host;
const char *port;
- struct addrinfo *ai_list, *ai_ptr;
+ struct addrinfo *ai_list;
int ai_return;
host = hddtemp_host;
struct addrinfo ai_hints = {
.ai_flags = AI_ADDRCONFIG,
- .ai_family = PF_UNSPEC,
+ .ai_family = AF_UNSPEC,
.ai_protocol = IPPROTO_TCP,
.ai_socktype = SOCK_STREAM
};
}
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,
char *saveptr;
int num_fields;
int num_disks;
- int i;
/* get data from daemon */
if (hddtemp_query_daemon (buf, sizeof (buf)) < 0)
num_disks = num_fields / 4;
- for (i = 0; i < num_disks; i++)
+ for (int i = 0; i < num_disks; i++)
{
char *name;
double temperature;