Merge branch 'collectd-4.10' into collectd-5.1
authorFlorian Forster <octo@collectd.org>
Sun, 3 Feb 2013 10:36:37 +0000 (11:36 +0100)
committerFlorian Forster <octo@collectd.org>
Sun, 3 Feb 2013 10:36:37 +0000 (11:36 +0100)
Conflicts:
src/curl_json.c

src/apache.c
src/ascent.c
src/bind.c
src/cpu.c
src/curl.c
src/curl_json.c
src/curl_xml.c
src/logfile.c
src/nginx.c
src/write_http.c

index c31dd87..202b73c 100644 (file)
@@ -373,7 +373,7 @@ static int init_host (apache_t *st) /* {{{ */
                return (-1);
        }
 
-       curl_easy_setopt (st->curl, CURLOPT_NOSIGNAL, 1);
+       curl_easy_setopt (st->curl, CURLOPT_NOSIGNAL, 1L);
        curl_easy_setopt (st->curl, CURLOPT_WRITEFUNCTION, apache_curl_callback);
        curl_easy_setopt (st->curl, CURLOPT_WRITEDATA, st);
 
@@ -425,24 +425,24 @@ static int init_host (apache_t *st) /* {{{ */
        }
 
        curl_easy_setopt (st->curl, CURLOPT_URL, st->url);
-       curl_easy_setopt (st->curl, CURLOPT_FOLLOWLOCATION, 1);
+       curl_easy_setopt (st->curl, CURLOPT_FOLLOWLOCATION, 1L);
 
        if (st->verify_peer != 0)
        {
-               curl_easy_setopt (st->curl, CURLOPT_SSL_VERIFYPEER, 1);
+               curl_easy_setopt (st->curl, CURLOPT_SSL_VERIFYPEER, 1L);
        }
        else
        {
-               curl_easy_setopt (st->curl, CURLOPT_SSL_VERIFYPEER, 0);
+               curl_easy_setopt (st->curl, CURLOPT_SSL_VERIFYPEER, 0L);
        }
 
        if (st->verify_host != 0)
        {
-               curl_easy_setopt (st->curl, CURLOPT_SSL_VERIFYHOST, 2);
+               curl_easy_setopt (st->curl, CURLOPT_SSL_VERIFYHOST, 2L);
        }
        else
        {
-               curl_easy_setopt (st->curl, CURLOPT_SSL_VERIFYHOST, 0);
+               curl_easy_setopt (st->curl, CURLOPT_SSL_VERIFYHOST, 0L);
        }
 
        if (st->cacert != NULL)
index 993e480..3a7c393 100644 (file)
@@ -539,7 +539,7 @@ static int ascent_init (void) /* {{{ */
     return (-1);
   }
 
-  curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1);
+  curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1L);
   curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, ascent_curl_callback);
   curl_easy_setopt (curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION);
   curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, ascent_curl_error);
@@ -561,17 +561,17 @@ static int ascent_init (void) /* {{{ */
   }
 
   curl_easy_setopt (curl, CURLOPT_URL, url);
-  curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
+  curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1L);
 
   if ((verify_peer == NULL) || IS_TRUE (verify_peer))
-    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);
+    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1L);
   else
-    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0);
+    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0L);
 
   if ((verify_host == NULL) || IS_TRUE (verify_host))
-    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 2);
+    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 2L);
   else
-    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0);
+    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0L);
 
   if (cacert != NULL)
     curl_easy_setopt (curl, CURLOPT_CAINFO, cacert);
index 5b7d7a0..288949a 100644 (file)
@@ -1393,12 +1393,12 @@ static int bind_init (void) /* {{{ */
     return (-1);
   }
 
-  curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1);
+  curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1L);
   curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, bind_curl_callback);
   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);
+  curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1L);
 
   return (0);
 } /* }}} int bind_init */
index 12071a2..86c6442 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -344,8 +344,6 @@ static int cpu_read (void)
 
                cpu_temp_retry_counter = 0;
                cpu_temp_retry_step    = 1;
-
-               DEBUG ("cpu_temp = %i", (int) cpu_temp);
 #endif /* PROCESSOR_TEMPERATURE */
        }
 /* #endif PROCESSOR_CPU_LOAD_INFO */
index 2160b98..69a5b95 100644 (file)
@@ -370,14 +370,14 @@ static int cc_page_init_curl (web_page_t *wp) /* {{{ */
     return (-1);
   }
 
-  curl_easy_setopt (wp->curl, CURLOPT_NOSIGNAL, 1);
+  curl_easy_setopt (wp->curl, CURLOPT_NOSIGNAL, 1L);
   curl_easy_setopt (wp->curl, CURLOPT_WRITEFUNCTION, cc_curl_callback);
   curl_easy_setopt (wp->curl, CURLOPT_WRITEDATA, wp);
   curl_easy_setopt (wp->curl, CURLOPT_USERAGENT,
       PACKAGE_NAME"/"PACKAGE_VERSION);
   curl_easy_setopt (wp->curl, CURLOPT_ERRORBUFFER, wp->curl_errbuf);
   curl_easy_setopt (wp->curl, CURLOPT_URL, wp->url);
-  curl_easy_setopt (wp->curl, CURLOPT_FOLLOWLOCATION, 1);
+  curl_easy_setopt (wp->curl, CURLOPT_FOLLOWLOCATION, 1L);
 
   if (wp->user != NULL)
   {
@@ -399,9 +399,9 @@ static int cc_page_init_curl (web_page_t *wp) /* {{{ */
     curl_easy_setopt (wp->curl, CURLOPT_USERPWD, wp->credentials);
   }
 
-  curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYPEER, wp->verify_peer);
+  curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYPEER, (long) wp->verify_peer);
   curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYHOST,
-      wp->verify_host ? 2 : 0);
+      wp->verify_host ? 2L : 0L);
   if (wp->cacert != NULL)
     curl_easy_setopt (wp->curl, CURLOPT_CAINFO, wp->cacert);
 
index cc8b4ad..2ddaff3 100644 (file)
@@ -521,7 +521,7 @@ static int cj_init_curl (cj_t *db) /* {{{ */
     return (-1);
   }
 
-  curl_easy_setopt (db->curl, CURLOPT_NOSIGNAL, 1);
+  curl_easy_setopt (db->curl, CURLOPT_NOSIGNAL, 1L);
   curl_easy_setopt (db->curl, CURLOPT_WRITEFUNCTION, cj_curl_callback);
   curl_easy_setopt (db->curl, CURLOPT_WRITEDATA, db);
   curl_easy_setopt (db->curl, CURLOPT_USERAGENT,
@@ -549,9 +549,9 @@ static int cj_init_curl (cj_t *db) /* {{{ */
     curl_easy_setopt (db->curl, CURLOPT_USERPWD, db->credentials);
   }
 
-  curl_easy_setopt (db->curl, CURLOPT_SSL_VERIFYPEER, (int) db->verify_peer);
+  curl_easy_setopt (db->curl, CURLOPT_SSL_VERIFYPEER, (long) db->verify_peer);
   curl_easy_setopt (db->curl, CURLOPT_SSL_VERIFYHOST,
-                    (int) (db->verify_host ? 2 : 0));
+                    db->verify_host ? 2L : 0L);
   if (db->cacert != NULL)
     curl_easy_setopt (db->curl, CURLOPT_CAINFO, db->cacert);
 
index 46e0d49..da90d7c 100644 (file)
@@ -737,7 +737,7 @@ static int cx_init_curl (cx_t *db) /* {{{ */
     return (-1);
   }
 
-  curl_easy_setopt (db->curl, CURLOPT_NOSIGNAL, 1);
+  curl_easy_setopt (db->curl, CURLOPT_NOSIGNAL, 1L);
   curl_easy_setopt (db->curl, CURLOPT_WRITEFUNCTION, cx_curl_callback);
   curl_easy_setopt (db->curl, CURLOPT_WRITEDATA, db);
   curl_easy_setopt (db->curl, CURLOPT_USERAGENT,
index ded7732..0f20f3c 100644 (file)
@@ -81,7 +81,7 @@ static void logfile_print (const char *msg, int severity,
                cdtime_t timestamp_time)
 {
        FILE *fh;
-       int do_close = 0;
+       _Bool do_close = 0;
        struct tm timestamp_tm;
        char timestamp_str[64];
        char level_str[16] = "";
@@ -151,8 +151,11 @@ static void logfile_print (const char *msg, int severity,
                else
                        fprintf (fh, "%s%s\n", level_str, msg);
 
-               if (do_close != 0)
+               if (do_close) {
                        fclose (fh);
+               } else {
+                       fflush(fh);
+               }
        }
 
        pthread_mutex_unlock (&file_lock);
index 3e162ba..b76f25b 100644 (file)
@@ -120,7 +120,7 @@ static int init (void)
     return (-1);
   }
 
-  curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1);
+  curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1L);
   curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, nginx_curl_callback);
   curl_easy_setopt (curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION);
   curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, nginx_curl_error);
@@ -143,24 +143,24 @@ static int init (void)
     curl_easy_setopt (curl, CURLOPT_URL, url);
   }
 
-  curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
+  curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1L);
 
   if ((verify_peer == NULL) || IS_TRUE (verify_peer))
   {
-    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);
+    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1L);
   }
   else
   {
-    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0);
+    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0L);
   }
 
   if ((verify_host == NULL) || IS_TRUE (verify_host))
   {
-    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 2);
+    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 2L);
   }
   else
   {
-    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0);
+    curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0L);
   }
 
   if (cacert != NULL)
index 3035e43..6b1c64a 100644 (file)
@@ -111,7 +111,7 @@ static int wh_callback_init (wh_callback_t *cb) /* {{{ */
                 return (-1);
         }
 
-        curl_easy_setopt (cb->curl, CURLOPT_NOSIGNAL, 1);
+        curl_easy_setopt (cb->curl, CURLOPT_NOSIGNAL, 1L);
         curl_easy_setopt (cb->curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION);
 
         headers = NULL;
@@ -147,9 +147,9 @@ static int wh_callback_init (wh_callback_t *cb) /* {{{ */
                 curl_easy_setopt (cb->curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
         }
 
-        curl_easy_setopt (cb->curl, CURLOPT_SSL_VERIFYPEER, cb->verify_peer);
+        curl_easy_setopt (cb->curl, CURLOPT_SSL_VERIFYPEER, (long) cb->verify_peer);
         curl_easy_setopt (cb->curl, CURLOPT_SSL_VERIFYHOST,
-                        cb->verify_host ? 2 : 0);
+                        cb->verify_host ? 2L : 0L);
         if (cb->cacert != NULL)
                 curl_easy_setopt (cb->curl, CURLOPT_CAINFO, cb->cacert);