X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fconfigfile.c;h=477d8816e84b8e32267bedfa71569d6d1304940b;hb=8822d7c9d8e86358cc4bb86e306ff90e40a15401;hp=70ee6d601911109905ffb59e0e7d0167320bcbb6;hpb=44cb6f804f46cc0a23968e27db129b86d058ac6e;p=collectd.git diff --git a/src/configfile.c b/src/configfile.c index 70ee6d60..477d8816 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -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 : "", - (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 : "", - (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 : "", - (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 : "", - (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 : "", - (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 : "", - (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 : "", - (value) ? value : "?"); + shortvar, var, arguments, value); if ((nesting_depth == 0) || (current_module == NULL)) {