]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/mac.c
Make cd accept wildcards
[bacula/bacula] / bacula / src / stored / mac.c
index 5641e7e8539ee0d4fefa0018ecc8d46d48404c4f..0797b244e8f1a26b5062733ee07d8b12f4b760b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2006-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2006-2011 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -94,14 +94,13 @@ bool do_mac(JCR *jcr)
    /* Ready devices for reading and writing */
    if (!acquire_device_for_read(jcr->read_dcr) ||
        !acquire_device_for_append(jcr->dcr)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       goto bail_out;
    }
 
    Dmsg2(200, "===== After acquire pos %u:%u\n", jcr->dcr->dev->file, jcr->dcr->dev->block_num);
      
-   set_jcr_job_status(jcr, JS_Running);
-   dir_send_job_status(jcr);
+   jcr->sendJobStatus(JS_Running);
 
    begin_data_spool(jcr->dcr);
    begin_attribute_spool(jcr);
@@ -158,20 +157,22 @@ ok_out:
       }
    }
 
-   dir_send_job_status(jcr);          /* update director */
+   jcr->sendJobStatus();              /* update director */
 
    Dmsg0(30, "Done reading.\n");
    jcr->end_time = time(NULL);
    dequeue_messages(jcr);             /* send any queued messages */
    if (ok) {
-      set_jcr_job_status(jcr, JS_Terminated);
+      jcr->setJobStatus(JS_Terminated);
    }
    generate_daemon_event(jcr, "JobEnd");
+   generate_plugin_event(jcr, bsdEventJobEnd);
    dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles,
       edit_uint64(jcr->JobBytes, ec1), jcr->JobErrors);
    Dmsg4(100, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, ec1); 
        
    dir->signal(BNET_EOD);             /* send EOD to Director daemon */
+   free_plugins(jcr);                 /* release instantiated plugins */
 
    return ok;
 }