projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/plugin.c: plugin_log: Print to stderr if no log plugin has been loaded.
[collectd.git]
/
src
/
plugin.c
diff --git
a/src/plugin.c
b/src/plugin.c
index
70e0c0f
..
24e5e01
100644
(file)
--- a/
src/plugin.c
+++ b/
src/plugin.c
@@
-888,6
+888,14
@@
int plugin_unregister_read (const char *name) /* {{{ */
}
le = llist_search (read_list, name);
}
le = llist_search (read_list, name);
+ if (le == NULL)
+ {
+ pthread_mutex_unlock (&read_lock);
+ WARNING ("plugin_unregister_read: No such read function: %s",
+ name);
+ return (-ENOENT);
+ }
+
llist_remove (read_list, le);
rf = le->value;
llist_remove (read_list, le);
rf = le->value;
@@
-1416,7
+1424,12
@@
void plugin_log (int level, const char *format, ...)
llentry_t *le;
if (list_log == NULL)
llentry_t *le;
if (list_log == NULL)
+ {
+ va_start (ap, format);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
return;
return;
+ }
#if !COLLECT_DEBUG
if (level >= LOG_DEBUG)
#if !COLLECT_DEBUG
if (level >= LOG_DEBUG)