projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/Makefile.am: Added utils_cmd_putval to exec_la_SOURCES.
[collectd.git]
/
src
/
plugin.c
diff --git
a/src/plugin.c
b/src/plugin.c
index
64dbf78
..
bed26f0
100644
(file)
--- a/
src/plugin.c
+++ b/
src/plugin.c
@@
-194,7
+194,7
@@
static void *plugin_read_thread (void *args)
rf->wait_time = 86400;
NOTICE ("read-function of plugin `%s' "
rf->wait_time = 86400;
NOTICE ("read-function of plugin `%s' "
- "failed. Will s
y
spend it for %i "
+ "failed. Will s
u
spend it for %i "
"seconds.", le->key, rf->wait_left);
}
else
"seconds.", le->key, rf->wait_left);
}
else
@@
-374,6
+374,12
@@
int plugin_register_config (const char *name,
return (0);
} /* int plugin_register_config */
return (0);
} /* int plugin_register_config */
+int plugin_register_complex_config (const char *type,
+ int (*callback) (oconfig_item_t *))
+{
+ return (cf_register_complex (type, callback));
+} /* int plugin_register_complex_config */
+
int plugin_register_init (const char *name,
int (*callback) (void))
{
int plugin_register_init (const char *name,
int (*callback) (void))
{
@@
-458,6
+464,12
@@
int plugin_unregister_config (const char *name)
return (0);
} /* int plugin_unregister_config */
return (0);
} /* int plugin_unregister_config */
+int plugin_unregister_complex_config (const char *name)
+{
+ cf_unregister_complex (name);
+ return (0);
+} /* int plugin_unregister_complex_config */
+
int plugin_unregister_init (const char *name)
{
return (plugin_unregister (list_init, name));
int plugin_unregister_init (const char *name)
{
return (plugin_unregister (list_init, name));
@@
-607,13
+619,18
@@
void plugin_shutdown_all (void)
while (le != NULL)
{
callback = (int (*) (void)) le->value;
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;
le = le->next;
+
+ (*callback) ();
}
} /* void plugin_shutdown_all */
}
} /* 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;
{
int (*callback) (const data_set_t *, const value_list_t *);
data_set_t *ds;
@@
-650,6
+667,11
@@
int plugin_dispatch_values (const char *name, const value_list_t *vl)
}
#endif
}
#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)
{
le = llist_head (list_write);
while (le != NULL)
{
@@
-660,7
+682,7
@@
int plugin_dispatch_values (const char *name, const value_list_t *vl)
}
return (0);
}
return (0);
-}
+}
/* int plugin_dispatch_values */
void plugin_log (int level, const char *format, ...)
{
void plugin_log (int level, const char *format, ...)
{