Merge pull request #2717 from dago/endian
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Wed, 4 Apr 2018 12:44:44 +0000 (14:44 +0200)
committerGitHub <noreply@github.com>
Wed, 4 Apr 2018 12:44:44 +0000 (14:44 +0200)
Add fallback for endianness conversion

README
src/daemon/collectd.c
src/filecount.c
src/ntpd.c

diff --git a/README b/README
index a47b669..43df03b 100644 (file)
--- a/README
+++ b/README
@@ -987,9 +987,8 @@ Configuring / Compiling / Installing
 ------------------------------------
 
   To configure, build and install collectd with the default settings, run
-  `./configure && make && make install'.  For detailed, generic instructions
-  see INSTALL. For a complete list of configure options and their description,
-  run `./configure --help'.
+  `./configure && make && make install'.  For a complete list of configure
+  options and their description, run `./configure --help'.
 
   By default, the configure script will check for all build dependencies and
   disable all plugins whose requirements cannot be fulfilled (any other plugin
index 727876b..e63c846 100644 (file)
@@ -449,7 +449,7 @@ struct cmdline_config {
   _Bool daemonize;
 };
 
-void read_cmdline(int argc, char **argv, struct cmdline_config *config) {
+static void read_cmdline(int argc, char **argv, struct cmdline_config *config) {
   /* read options */
   while (1) {
     int c;
@@ -496,7 +496,7 @@ void read_cmdline(int argc, char **argv, struct cmdline_config *config) {
   }   /* while (1) */
 }
 
-int configure_collectd(struct cmdline_config *config) {
+static int configure_collectd(struct cmdline_config *config) {
   const char *basedir;
   /*
    * Read options from the config file, the environment and the command
@@ -555,8 +555,7 @@ int main(int argc, char **argv) {
 
   plugin_init_ctx();
 
-  int status;
-  if ((status = configure_collectd(&config)) != 0)
+  if (configure_collectd(&config) != 0)
     exit(EXIT_FAILURE);
 
 #if COLLECT_DAEMON
index 7842aa6..67308f4 100644 (file)
@@ -63,7 +63,7 @@ typedef struct fc_directory_conf_s fc_directory_conf_t;
 static fc_directory_conf_t **directories = NULL;
 static size_t directories_num = 0;
 
-void fc_free_dir(fc_directory_conf_t *dir) {
+static void fc_free_dir(fc_directory_conf_t *dir) {
   sfree(dir->path);
   sfree(dir->plugin_name);
   sfree(dir->instance);
index 84512d2..ed3c042 100644 (file)
@@ -883,6 +883,12 @@ static int ntpd_read(void) {
       continue;
     }
 
+    // `0.0.0.0` hosts are caused by POOL servers
+    // see https://github.com/collectd/collectd/issues/2358
+    if (strcmp(peername, "0.0.0.0") == 0) {
+      continue;
+    }
+
     refclock_id = ntpd_get_refclock_id(ptr);
 
     /* Convert the `long floating point' offset value to double */