Fix this (a pointer was compared with an integer):
[collectd.git] / src / plugin.c
index 54f57af..570b6a2 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/plugin.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
@@ -26,6 +26,7 @@
 
 #include "plugin.h"
 #include "network.h"
+#include "utils_debug.h"
 
 typedef struct plugin
 {
@@ -114,11 +115,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)
        {
@@ -145,6 +154,8 @@ int plugin_load (const char *type)
        struct stat    statbuf;
        struct dirent *de;
 
+       DBG ("type = %s", type);
+
        dir = plugin_get_dir ();
        ret = 1;