From: Claudius Zingerli Date: Tue, 16 Feb 2016 13:27:14 +0000 (+0100) Subject: Surround incs with #if HAVE_xxx, removed unneeded casts, added lic note X-Git-Tag: collectd-5.6.0~258^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e1ef26fbf76276dfd6c83ca86772e0bcae969512;p=collectd.git Surround incs with #if HAVE_xxx, removed unneeded casts, added lic note --- diff --git a/src/chrony.c b/src/chrony.c index f170f67e..d40bbef5 100644 --- a/src/chrony.c +++ b/src/chrony.c @@ -11,12 +11,18 @@ * -> Done at higher levels */ -/* getaddrinfo */ -#include -#include -#include - -#include /* ntohs/ntohl */ +#if HAVE_SYS_TYPES_H +# include /* getaddrinfo */ +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +#if HAVE_NETDB_H +# include +#endif +#if HAVE_ARPA_INET_H +# include /* ntohs/ntohl */ +#endif #include "collectd.h" #include "common.h" /* auxiliary functions */ @@ -54,10 +60,10 @@ static uint32_t g_chrony_seq_is_initialized = 0; #define CHRONY_DEFAULT_TIMEOUT 2 /* Return codes (collectd expects non-zero on errors) */ -#define CHRONY_RC_OK (int)0 -#define CHRONY_RC_FAIL (int)1 +#define CHRONY_RC_OK 0 +#define CHRONY_RC_FAIL 1 -/* Variables adapted from chrony/candm.h */ +/* Variables adapted from chrony/candm.h (GPL2)*/ /*BEGIN*/ #define PROTO_VERSION_NUMBER 6 #define IPADDR_UNSPEC 0