]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/job.c
Apply Eric's next-beta.patch that enables 64 bit FileIds and
[bacula/bacula] / bacula / src / dird / job.c
index b20c7af0dd3dfe6bdc1fcb40bd07c7bbb125e77d..d70e589226f920e607ffb869910b9cd01b979180 100644 (file)
@@ -860,6 +860,7 @@ void update_job_end_record(JCR *jcr)
    jcr->jr.JobStatus = jcr->JobStatus;
    jcr->jr.JobFiles = jcr->JobFiles;
    jcr->jr.JobBytes = jcr->JobBytes;
+   jcr->jr.ReadBytes = jcr->ReadBytes;
    jcr->jr.VolSessionId = jcr->VolSessionId;
    jcr->jr.VolSessionTime = jcr->VolSessionTime;
    jcr->jr.JobErrors = jcr->Errors;
@@ -1023,8 +1024,6 @@ void dird_free_jcr(JCR *jcr)
       jcr->rstore_source = NULL;
    }
 
-   free_plugins(jcr);                 /* release instantiated plugins */
-
    /* Delete lists setup to hold storage pointers */
    free_rwstorage(jcr);
 
@@ -1033,6 +1032,8 @@ void dird_free_jcr(JCR *jcr)
    if (jcr->JobId != 0)
       write_state_file(director->working_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
 
+   free_plugins(jcr);                 /* release instantiated plugins */
+
    Dmsg0(200, "End dird free_jcr\n");
 }
 
@@ -1364,20 +1365,25 @@ bool create_restore_bootstrap_file(JCR *jcr)
    rx.JobIds = (char *)"";                       
    rx.bsr->JobId = jcr->previous_jr.JobId;
    ua = new_ua_context(jcr);
-   complete_bsr(ua, rx.bsr);
+   if (!complete_bsr(ua, rx.bsr)) {
+      goto bail_out;
+   }
    rx.bsr->fi = new_findex();
    rx.bsr->fi->findex = 1;
    rx.bsr->fi->findex2 = jcr->previous_jr.JobFiles;
    jcr->ExpectedFiles = write_bsr_file(ua, rx);
    if (jcr->ExpectedFiles == 0) {
-      free_ua_context(ua);
-      free_bsr(rx.bsr);
-      return false;
+      goto bail_out;
    }
    free_ua_context(ua);
    free_bsr(rx.bsr);
    jcr->needs_sd = true;
    return true;
+
+bail_out:
+   free_ua_context(ua);
+   free_bsr(rx.bsr);
+   return false;
 }
 
 /* TODO: redirect command ouput to job log */