summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7b1b6eb)
raw | patch | inline | side by side (parent: 7b1b6eb)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 19 Jul 2014 11:45:12 +0000 (13:45 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 19 Jul 2014 11:45:12 +0000 (13:45 +0200) |
Else, we'll get weird behavior when, for example, using LoadPlugin instead of
LoadBackend in sysdbd.
LoadBackend in sysdbd.
src/core/plugin.c | patch | blob | history |
diff --git a/src/core/plugin.c b/src/core/plugin.c
index 806e13c2f717f27b339ffd42b4cf43f4e2c3575b..919df2b3c982fed934b0495849817936907d9253 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
@@ -751,12 +751,16 @@ sdb_plugin_register_collector(const char *name, sdb_plugin_collector_cb callback
if (interval)
SDB_PLUGIN_CCB(obj)->ccb_interval = *interval;
else {
- sdb_time_t tmp = sdb_plugin_get_ctx().interval;
+ ctx_t *ctx = ctx_get();
- if (tmp > 0)
- SDB_PLUGIN_CCB(obj)->ccb_interval = tmp;
- else
- SDB_PLUGIN_CCB(obj)->ccb_interval = 0;
+ if (! ctx) {
+ sdb_log(SDB_LOG_ERR, "core: Cannot determine interval "
+ "for collector %s; none specified and no plugin "
+ "context found", cb_name);
+ return -1;
+ }
+
+ SDB_PLUGIN_CCB(obj)->ccb_interval = ctx->public.interval;
}
if (! (SDB_PLUGIN_CCB(obj)->ccb_next_update = sdb_gettime())) {