X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fbind.c;h=44efcfd55ba58982d6fdb2244a54ecac3b4e19b1;hp=c0b18323651c719d56edbfc671194731a8901d0e;hb=1641c82ec4e14968ea31021dfb8b520df5f4483a;hpb=e8999694aac7184ac4eea29564a2892f188c4171 diff --git a/src/bind.c b/src/bind.c index c0b18323..44efcfd5 100644 --- a/src/bind.c +++ b/src/bind.c @@ -21,31 +21,19 @@ * Florian Forster **/ -/* Set to C99 and POSIX code */ -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif -#ifndef _POSIX_SOURCE -# define _POSIX_SOURCE -#endif -#ifndef _POSIX_C_SOURCE -# define _POSIX_C_SOURCE 200112L -#endif -#ifndef _REENTRANT -# define _REENTRANT -#endif -#ifndef _XOPEN_SOURCE -# define _XOPEN_SOURCE 600 -#endif -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif +#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 @@ -478,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);