const char *error = lt_dlerror ();
ERROR ("lt_dlopen failed: %s", error);
- DEBUG ("lt_dlopen failed: %s", error);
return (1);
}
while (le != NULL)
{
callback = (int (*) (void)) le->value;
- (*callback) ();
+ /* Advance the pointer before calling the callback allows
+ * shutdown functions to unregister themselves. If done the
+ * other way around the memory `le' points to will be freed
+ * after callback returns. */
le = le->next;
+
+ (*callback) ();
}
} /* void plugin_shutdown_all */
-int plugin_dispatch_values (const char *name, const value_list_t *vl)
+int plugin_dispatch_values (const char *name, value_list_t *vl)
{
int (*callback) (const data_set_t *, const value_list_t *);
data_set_t *ds;
}
#endif
+ escape_slashes (vl->host, sizeof (vl->host));
+ escape_slashes (vl->plugin, sizeof (vl->plugin));
+ escape_slashes (vl->plugin_instance, sizeof (vl->plugin_instance));
+ escape_slashes (vl->type_instance, sizeof (vl->type_instance));
+
le = llist_head (list_write);
while (le != NULL)
{
}
return (0);
-}
+} /* int plugin_dispatch_values */
void plugin_log (int level, const char *format, ...)
{