[collectd] [PATCH] plugin.c: Tell the user if a plugin could not be found.
Sebastian Harl
sh at tokkee.org
Mon Mar 31 10:46:42 CEST 2008
Up to now this error was silently ignored, letting the user believe that
everything went fine.
Signed-off-by: Sebastian Harl <sh at tokkee.org>
---
src/plugin.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/plugin.c b/src/plugin.c
index cf03849..29603b2 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -314,7 +314,7 @@ int plugin_load (const char *type)
{
DIR *dh;
const char *dir;
- char filename[BUFSIZE];
+ char filename[BUFSIZE] = "";
char typename[BUFSIZE];
int typename_len;
int ret;
@@ -381,6 +381,9 @@ int plugin_load (const char *type)
closedir (dh);
+ if (filename[0] == '\0')
+ fprintf (stderr, "Could not find plugin %s.\n", type);
+
return (ret);
}
--
1.5.5.rc2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080331/acab643c/attachment.pgp
More information about the collectd
mailing list