]> git.sur5r.net Git - bacula/bacula/commitdiff
Backport better error debug output for sd plugins.
authorMarco van Wieringen <mvw@planets.elm.net>
Sun, 29 Jan 2012 16:50:07 +0000 (17:50 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:50:31 +0000 (14:50 +0200)
bacula/src/stored/sd_plugins.c

index f142182a5c93cd84ac01bd20ce9e097691d291dc..2ed955c857bffebc3e601b01b554f82108c60fd0 100644 (file)
@@ -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();