collectd-python(5): Fixed the AUTHOR section.
[collectd.git] / src / plugin.c
index 7b30e21..24b2698 100644 (file)
@@ -280,6 +280,7 @@ static int plugin_load_file (char *file, uint32_t flags)
        lt_dlinit ();
        lt_dlerror (); /* clear errors */
 
+#if LIBTOOL_VERSION == 2
        if (flags & PLUGIN_FLAGS_GLOBAL) {
                lt_dladvise advise;
                lt_dladvise_init(&advise);
@@ -289,6 +290,13 @@ static int plugin_load_file (char *file, uint32_t flags)
        } else {
                dlh = lt_dlopen (file);
        }
+#else /* if LIBTOOL_VERSION == 1 */
+       if (flags & PLUGIN_FLAGS_GLOBAL)
+               ERROR ("plugin_load_file: The global flag is not supported, "
+                               "libtool 2 is required for this.");
+       dlh = lt_dlopen (file);
+#endif
+
        if (dlh == NULL)
        {
                const char *error = lt_dlerror ();
@@ -1453,7 +1461,12 @@ void plugin_log (int level, const char *format, ...)
        llentry_t *le;
 
        if (list_log == NULL)
+       {
+               va_start (ap, format);
+               vfprintf (stderr, format, ap);
+               va_end (ap);
                return;
+       }
 
 #if !COLLECT_DEBUG
        if (level >= LOG_DEBUG)