Code

Merge pull request #1375 from rubenk/redis-unlock-lock
[collectd.git] / src / nginx.c
index edb55b9e986e5af91eed8d0dcbc1e31499c8f106..69ec06dc996edc9452ea565776c9d9d70c241e68 100644 (file)
@@ -181,15 +181,16 @@ 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()));
+    curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS, (long) CDTIME_T_TO_MS(plugin_get_interval()));
   }
+#endif
 
   return (0);
 } /* void init */