#if HAVE_TIMEGM
time_t t = timegm(&tm);
if (t == ((time_t)-1)) {
- char errbuf[1024];
- ERROR("bind plugin: timegm() failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("bind plugin: timegm() failed: %s", STRERRNO);
return -1;
}
*ret_value = t;
#else
time_t t = mktime(&tm);
if (t == ((time_t)-1)) {
- char errbuf[1024];
- ERROR("bind plugin: mktime() failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("bind plugin: mktime() failed: %s", STRERRNO);
return -1;
}
/* mktime assumes that tm is local time. Luckily, it also sets timezone to
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, bind_curl_callback);
curl_easy_setopt(curl, CURLOPT_USERAGENT, COLLECTD_USERAGENT);
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, 1L);
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
#ifdef HAVE_CURLOPT_TIMEOUT_MS
}
bind_buffer_fill = 0;
+
+ curl_easy_setopt(curl, CURLOPT_URL, (url != NULL) ? url : BIND_DEFAULT_URL);
+
if (curl_easy_perform(curl) != CURLE_OK) {
ERROR("bind plugin: curl_easy_perform failed: %s", bind_curl_error);
return -1;