Merge branch 'collectd-5.4' into collectd-5.5
[collectd.git] / src / nginx.c
index edb55b9..4e4ce3b 100644 (file)
@@ -181,15 +181,17 @@ static int init (void)
     curl_easy_setopt (curl, CURLOPT_CAINFO, cacert);
   }
 
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
   if (timeout != NULL)
   {
-    curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS, atoi(timeout));
+    curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS, atol(timeout));
   }
   else
   {
     curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS,
        CDTIME_T_TO_MS(plugin_get_interval()));
   }
+#endif
 
   return (0);
 } /* void init */