X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhddtemp.c;h=0432de73adc825c9ac161bc3ea5dc5a5800f68a9;hb=8a35017c70b0fc1a3531a0b630071dedbbaa9372;hp=d60481e35663313c34b05abd6c4aedabf82f652d;hpb=1fab9727d3020c9c733aab0ab2386f593bd52a11;p=collectd.git diff --git a/src/hddtemp.c b/src/hddtemp.c index d60481e3..0432de73 100644 --- a/src/hddtemp.c +++ b/src/hddtemp.c @@ -31,17 +31,11 @@ #include "plugin.h" #include "configfile.h" -#if HAVE_NETDB_H && HAVE_SYS_SOCKET_H && HAVE_NETINET_IN_H \ - && HAVE_NETINET_TCP_H && HAVE_LIBGEN_H # include # include # include # include # include /* for basename */ -# define HDDTEMP_HAVE_READ 1 -#else -# define HDDTEMP_HAVE_READ 0 -#endif #if HAVE_LINUX_MAJOR_H # include @@ -50,7 +44,6 @@ #define HDDTEMP_DEF_HOST "127.0.0.1" #define HDDTEMP_DEF_PORT "7634" -#if HDDTEMP_HAVE_READ static const char *config_keys[] = { "Host", @@ -108,7 +101,10 @@ static int hddtemp_query_daemon (char *buffer, int buffer_size) int ai_return; memset (&ai_hints, '\0', sizeof (ai_hints)); - ai_hints.ai_flags = AI_ADDRCONFIG; + ai_hints.ai_flags = 0; +#ifdef AI_ADDRCONFIG + ai_hints.ai_flags |= AI_ADDRCONFIG; +#endif ai_hints.ai_family = PF_UNSPEC; ai_hints.ai_socktype = SOCK_STREAM; ai_hints.ai_protocol = IPPROTO_TCP; @@ -504,16 +500,13 @@ static int hddtemp_read (void) return (0); } /* int hddtemp_read */ -#endif /* HDDTEMP_HAVE_READ */ /* module_register Register collectd plugin. */ void module_register (void) { -#if HDDTEMP_HAVE_READ plugin_register_config ("hddtemp", hddtemp_config, config_keys, config_keys_num); plugin_register_init ("hddtemp", hddtemp_init); plugin_register_read ("hddtemp", hddtemp_read); -#endif /* HDDTEMP_HAVE_READ */ }