Merge branch 'collectd-4.6' into collectd-4.7
authorFlorian Forster <octo@huhu.verplant.org>
Wed, 15 Jul 2009 09:10:19 +0000 (11:10 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Wed, 15 Jul 2009 09:10:19 +0000 (11:10 +0200)
Conflicts:

src/memcached.c

build.sh
src/configfile.c
src/cpu.c
src/memcached.c
src/utils_cache.c
version-gen.sh

index 804b2e2..20854b1 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -6,7 +6,8 @@ check_for_application ()
 {
        for PROG in "$@"
        do
-               if ! which "$PROG" >/dev/null 2>&1; then
+               which "$PROG" >/dev/null 2>&1
+               if test $? -ne 0; then
                        cat >&2 <<EOF
 WARNING: \`$PROG' not found!
     Please make sure that \`$PROG' is installed and is in one of the
index 53f3314..d401a2e 100644 (file)
@@ -336,7 +336,15 @@ static int dispatch_block_plugin (oconfig_item_t *ci)
                if (ci->children[i].children == NULL)
                        dispatch_value_plugin (name, ci->children + i);
                else
-                       {DEBUG ("No nested config blocks allowed for this plugin.");}
+               {
+                       WARNING ("There is a `%s' block within the "
+                                       "configuration for the %s plugin. "
+                                       "The plugin either only expects "
+                                       "\"simple\" configuration statements "
+                                       "or wasn't loaded using `LoadPlugin'."
+                                       " Please check your configuration.",
+                                       ci->children[i].key, name);
+               }
        }
 
        return (0);
index 64ce5df..dc44a50 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -220,7 +220,7 @@ static void submit (int cpu_num, const char *type_instance, counter_t value)
        vl.values_len = 1;
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "cpu", sizeof (vl.plugin));
-       ssnprintf (vl.plugin_instance, sizeof (vl.type_instance),
+       ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
                        "%i", cpu_num);
        sstrncpy (vl.type, "cpu", sizeof (vl.type));
        sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
index 06cf200..b332157 100644 (file)
@@ -115,7 +115,7 @@ static int memcached_query_daemon (char *buffer, int buffer_size) /* {{{ */
                        port = MEMCACHED_DEF_PORT;
                }
 
-               if ((ai_return = getaddrinfo (host, port, NULL, &ai_list)) != 0) {
+               if ((ai_return = getaddrinfo (host, port, &ai_hints, &ai_list)) != 0) {
                        char errbuf[1024];
                        ERROR ("memcached: getaddrinfo (%s, %s): %s",
                                        host, port,
index 3cfe3a1..60d3283 100644 (file)
@@ -305,6 +305,7 @@ int uc_check_timeout (void)
       sfree (keys[i]);
       sfree (key);
       cache_free (ce);
+      continue;
     }
 
     /* If we get here, the value is ``interesting''. Query the record from the
@@ -349,6 +350,10 @@ int uc_check_timeout (void)
          keys[i], status);
       sfree (keys[i]);
     }
+
+    /* Make really sure the next iteration doesn't work with this pointer.
+     * There have been too many bugs in the past.. :/  -- octo */
+    ce = NULL;
   } /* for (keys[i]) */
 
   c_avl_iterator_destroy (iter);
index 6fcfb1e..cfced9e 100755 (executable)
@@ -2,13 +2,12 @@
 
 DEFAULT_VERSION="4.7.1.git"
 
-VERSION="$( git describe 2> /dev/null | sed -e 's/^collectd-//' )"
+VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
 
 if test -z "$VERSION"; then
        VERSION="$DEFAULT_VERSION"
 fi
 
-VERSION=$( echo "$VERSION" | sed -e 's/-/./g' )
-
-echo -n $VERSION
+VERSION="`echo \"$VERSION\" | sed -e 's/-/./g'`"
 
+echo -n "$VERSION"