From: Marco van Wieringen Date: Sun, 29 Jan 2012 16:50:07 +0000 (+0100) Subject: Backport better error debug output for sd plugins. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ec212180f457a25d228e3ba697a9df9080102880;p=bacula%2Fbacula Backport better error debug output for sd plugins. --- diff --git a/bacula/src/stored/sd_plugins.c b/bacula/src/stored/sd_plugins.c index f142182a5c..2ed955c857 100644 --- a/bacula/src/stored/sd_plugins.c +++ b/bacula/src/stored/sd_plugins.c @@ -107,10 +107,20 @@ int generate_plugin_event(JCR *jcr, bsdEventType eventType, void *value) int i = 0; bRC rc = bRC_OK; - if (!bplugin_list || !jcr || !jcr->plugin_ctx_list) { + if (!bplugin_list) { + Dmsg0(dbglvl, "No bplugin_list: generate_plugin_event ignored.\n"); + return bRC_OK; + } + if (!jcr) { + Dmsg0(dbglvl, "No jcr: generate_plugin_event ignored.\n"); + return bRC_OK; + } + if (!jcr->plugin_ctx_list) { + Dmsg0(dbglvl, "No plugin_ctx_list: generate_plugin_event ignored.\n"); return bRC_OK; /* Return if no plugins loaded */ } if (jcr->is_job_canceled()) { + Dmsg0(dbglvl, "Cancel return from generate_plugin_event\n"); return bRC_Cancel; } @@ -251,6 +261,12 @@ void new_plugins(JCR *jcr) if (jcr->is_job_canceled()) { return; } + /* + * If plugins already loaded, just return + */ + if (jcr->plugin_ctx_list) { + return; + } int num = bplugin_list->size();