X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdaemon%2Fconfigfile.c;h=2636a522bd45e5d50b3edb3ccd4ac8aab3264911;hp=02fd96f6fc2a09c2dd32dca7ca7a65c1c059f068;hb=cedb6f147e94d0e952449f731313412ef4d67904;hpb=b545dbd106a9a3c713041934aaa818a17cb1db10 diff --git a/src/daemon/configfile.c b/src/daemon/configfile.c index 02fd96f6..2636a522 100644 --- a/src/daemon/configfile.c +++ b/src/daemon/configfile.c @@ -397,9 +397,19 @@ static int dispatch_block_plugin (oconfig_item_t *ci) if (IS_TRUE (global_option_get ("AutoLoadPlugin"))) { + plugin_ctx_t ctx; + plugin_ctx_t old_ctx; int status; + /* default to the global interval set before loading this plugin */ + memset (&ctx, 0, sizeof (ctx)); + ctx.interval = cf_get_default_interval (); + + old_ctx = plugin_set_ctx (ctx); status = plugin_load (name, /* flags = */ 0); + /* reset to the "global" context */ + plugin_set_ctx (old_ctx); + if (status != 0) { ERROR ("Automatically loading plugin \"%s\" failed "