From: Florian Forster Date: Mon, 4 May 2009 14:48:58 +0000 (+0200) Subject: bind plugin: Fixes for FreeBSD 7.1 X-Git-Tag: collectd-4.7.0~13^2~7 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=1641c82ec4e14968ea31021dfb8b520df5f4483a;p=collectd.git bind plugin: Fixes for FreeBSD 7.1 X/Open is needed for strptime, sys/select.h is needed for some libcurl versions, and mktime is the POSIX variant of timegm (+ localization). --- diff --git a/src/bind.c b/src/bind.c index 587403d0..44efcfd5 100644 --- a/src/bind.c +++ b/src/bind.c @@ -21,12 +21,19 @@ * Florian Forster **/ +#define _XOPEN_SOURCE 600 /* glibc2 needs this for strptime */ #include "collectd.h" #include "common.h" #include "plugin.h" #include "configfile.h" +/* Some versions of libcurl don't include this themselves and then don't have + * fd_set available. */ +#if HAVE_SYS_SELECT_H +# include +#endif + #include #include #include @@ -459,7 +466,7 @@ static int bind_xml_read_timestamp (const char *xpath_expression, /* {{{ */ return (-1); } - *ret_value = timegm(&tm); + *ret_value = mktime(&tm); xmlXPathFreeObject (xpathObj); return (0);