From ec212180f457a25d228e3ba697a9df9080102880 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Sun, 29 Jan 2012 17:50:07 +0100 Subject: [PATCH] Backport better error debug output for sd plugins. --- bacula/src/stored/sd_plugins.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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(); -- 2.39.5