X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbind.c;h=47215c74bae0b6422d058dd5697a9d1fc180f0b6;hb=8eb9e6285f394569d7fe6ad43a0f4e5f9bca454f;hp=3d46e51e043846cf160298973d391727f56b2371;hpb=9ce08d6e5e67d89e29a21883bdca5b79d1f908a9;p=collectd.git diff --git a/src/bind.c b/src/bind.c index 3d46e51e..47215c74 100644 --- a/src/bind.c +++ b/src/bind.c @@ -21,7 +21,11 @@ * Florian Forster **/ -#define _XOPEN_SOURCE 600 /* glibc2 needs this for strptime */ +#include "config.h" + +#ifndef _XOPEN_SOURCE +# define _XOPEN_SOURCE 600 /* glibc2 needs this for strptime */ +#endif #include "collectd.h" #include "common.h" @@ -237,7 +241,7 @@ static void submit (time_t ts, const char *plugin_instance, /* {{{ */ vl.values = values; vl.values_len = 1; - vl.time = ts; + vl.time = TIME_T_TO_CDTIME_T (ts); sstrncpy(vl.host, hostname_g, sizeof(vl.host)); sstrncpy(vl.plugin, "bind", sizeof(vl.plugin)); if (plugin_instance) { @@ -1382,6 +1386,7 @@ static int bind_init (void) /* {{{ */ curl_easy_setopt (curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION); curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, bind_curl_error); curl_easy_setopt (curl, CURLOPT_URL, (url != NULL) ? url : BIND_DEFAULT_URL); + curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1); return (0); } /* }}} int bind_init */