From e1ef26fbf76276dfd6c83ca86772e0bcae969512 Mon Sep 17 00:00:00 2001 From: Claudius Zingerli Date: Tue, 16 Feb 2016 14:27:14 +0100 Subject: [PATCH] Surround incs with #if HAVE_xxx, removed unneeded casts, added lic note --- src/chrony.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) 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 -- 2.30.2