From: octo Date: Tue, 11 Apr 2006 18:41:30 +0000 (+0000) Subject: Added useful error- and debug-messages. X-Git-Tag: liboping-0.1.0~106 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2d467bf3008432979ff01a755c993489934b7649;p=collectd.git Added useful error- and debug-messages. --- diff --git a/src/plugin.c b/src/plugin.c index fc79668d..cbdb9426 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -26,6 +26,7 @@ #include "plugin.h" #include "network.h" +#include "utils_debug.h" typedef struct plugin { @@ -116,11 +117,19 @@ int plugin_load_file (char *file) lt_dlhandle dlh; void (*reg_handle) (void); + DBG ("file = %s", file); + lt_dlinit (); lt_dlerror (); /* clear errors */ if ((dlh = lt_dlopen (file)) == NULL) + { + const char *error = lt_dlerror (); + + syslog (LOG_ERR, "lt_dlopen failed: %s", error); + DBG ("lt_dlopen failed: %s", error); return (1); + } if ((reg_handle = lt_dlsym (dlh, "module_register")) == NULL) { @@ -147,6 +156,8 @@ int plugin_load (const char *type) struct stat statbuf; struct dirent *de; + DBG ("type = %s", type); + dir = plugin_get_dir (); ret = 1;