octo@crystal:~/Projects/collectd $ svn merge -r646:651 trunk tags/collectd-3.9.1
[collectd.git] / src / configfile.c
index 70ee6d6..477d881 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/configfile.c
- * Copyright (C) 2005  Florian octo Forster
+ * Copyright (C) 2005,2006  Florian octo Forster
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -106,7 +106,7 @@ static int cf_dispatch (char *type, const char *orig_key, const char *orig_value
 
        if ((cf_cb = cf_search (type)) == NULL)
        {
-               syslog (LOG_WARNING, "Plugin `%s' did not register a callback.\n", type);
+               syslog (LOG_WARNING, "Plugin `%s' did not register a callback.", type);
                return (-1);
        }
 
@@ -130,11 +130,13 @@ static int cf_dispatch (char *type, const char *orig_key, const char *orig_value
        }
 
        if (i >= cf_cb->keys_num)
-               syslog (LOG_WARNING, "Plugin `%s' did not register for value `%s'.\n", type, key);
+               syslog (LOG_WARNING, "Plugin `%s' did not register for value `%s'.", type, key);
 
        free (key);
        free (value);
 
+       DBG ("return (%i)", ret);
+
        return (ret);
 }
 
@@ -236,8 +238,7 @@ static int cf_callback_mode (const char *shortvar, const char *var,
                void *extra)
 {
        DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
-             shortvar, var, (arguments) ? arguments : "<NULL>",
-             (value) ? value : "?");
+                       shortvar, var, arguments, value);
 
        if (strcasecmp (value, "Client") == 0)
                operating_mode = MODE_CLIENT;
@@ -271,8 +272,7 @@ static int cf_callback_mode_plugindir (const char *shortvar, const char *var,
                void *extra)
 {
        DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
-             shortvar, var, (arguments) ? arguments : "<NULL>",
-             (value) ? value : "?");
+                       shortvar, var, arguments, value);
 
        plugin_set_dir (value);
 
@@ -286,8 +286,7 @@ static int cf_callback_mode_option (const char *shortvar, const char *var,
        cf_mode_item_t *item;
 
        DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
-             shortvar, var, (arguments) ? arguments : "<NULL>",
-             (value) ? value : "?");
+                       shortvar, var, arguments, value);
 
        if (extra == NULL)
        {
@@ -337,8 +336,7 @@ static int cf_callback_mode_loadmodule (const char *shortvar, const char *var,
                void *extra)
 {
        DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
-             shortvar, var, (arguments) ? arguments : "<NULL>",
-             (value) ? value : "?");
+                       shortvar, var, arguments, value);
 
        if (plugin_load (value))
                syslog (LOG_ERR, "plugin_load (%s): failed to load plugin", value);
@@ -361,8 +359,7 @@ static int cf_callback_socket (const char *shortvar, const char *var,
        char *service = NET_DEFAULT_PORT;
 
        DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
-             shortvar, var, (arguments) ? arguments : "<NULL>",
-             (value) ? value : "?");
+                       shortvar, var, arguments, value);
 
        buffer = strdup (value);
        if (buffer == NULL)
@@ -405,8 +402,7 @@ static int cf_callback_plugin (const char *shortvar, const char *var,
                void *extra)
 {
        DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
-             shortvar, var, (arguments) ? arguments : "<NULL>",
-             (value) ? value : "?");
+                       shortvar, var, arguments, value);
 
        if (flags == LC_FLAGS_SECTIONSTART)
        {
@@ -467,8 +463,7 @@ static int cf_callback_plugin_dispatch (const char *shortvar, const char *var,
                void *extra)
 {
        DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
-             shortvar, var, (arguments) ? arguments : "<NULL>",
-             (value) ? value : "?");
+                       shortvar, var, arguments, value);
 
        if ((nesting_depth == 0) || (current_module == NULL))
        {