From dd7eb19ac13a5eb4e39894a0d613067a70f194a0 Mon Sep 17 00:00:00 2001 From: octo Date: Wed, 14 Dec 2005 14:26:14 +0000 Subject: [PATCH] Changed error messages for calls to `mkdir': Report creation of which directory failed Fixed small but in the call to `plugin_load': We need the `value', not the `key'.. --- src/collectd.c | 4 ++-- src/common.c | 4 ++-- src/configfile.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/collectd.c b/src/collectd.c index 348623c0..ca7edb54 100644 --- a/src/collectd.c +++ b/src/collectd.c @@ -70,12 +70,12 @@ int change_basedir (char *dir) { if (mkdir (dir, 0755) == -1) { - syslog (LOG_ERR, "mkdir: %s", strerror (errno)); + syslog (LOG_ERR, "mkdir (%s): %s", dir, strerror (errno)); return (-1); } else if (chdir (dir) == -1) { - syslog (LOG_ERR, "chdir: %s", strerror (errno)); + syslog (LOG_ERR, "chdir (%s): %s", dir, strerror (errno)); return (-1); } } diff --git a/src/common.c b/src/common.c index d946cfb4..1eec286a 100644 --- a/src/common.c +++ b/src/common.c @@ -105,13 +105,13 @@ int check_create_dir (char *dir) { if (mkdir (dir, 0755) == -1) { - syslog (LOG_ERR, "mkdir %s: %s", dir, strerror (errno)); + syslog (LOG_ERR, "mkdir (%s): %s", dir, strerror (errno)); return (-1); } } else { - syslog (LOG_ERR, "stat %s: %s", dir, strerror (errno)); + syslog (LOG_ERR, "stat (%s): %s", dir, strerror (errno)); return (-1); } } diff --git a/src/configfile.c b/src/configfile.c index 0d1569f9..5cdd7360 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -321,7 +321,7 @@ int cf_callback_loadmodule (const char *shortvar, const char *var, return (LC_CBRET_ERROR); } - if (plugin_load (shortvar)) + if (plugin_load (value)) syslog (LOG_ERR, "plugin_load (%s): failed to load plugin", shortvar); /* Return `okay' even if there was an error, because it's not a syntax -- 2.30.2