src/dird/job.c
int create_restore_bootstrap_file(JCR *jcr, JobId_t jobid, int findex1, int findex2)
{
   RESTORE_CTX rx;
   UAContext *ua;
   int files;

   memset(&rx, 0, sizeof(rx));
   rx.JobIds = (char *)"";

   rx.bsr_list = create_bsr_list(jobid, findex1, findex2);

   ua = new_ua_context(jcr);
   if (!complete_bsr(ua, rx.bsr_list)) {
      files = -1;
      goto bail_out;
   }

   jcr->ExpectedFiles = write_bsr_file(ua, rx);
   if (jcr->ExpectedFiles == 0) {
      files = 0;
      goto bail_out;
   }
   free_ua_context(ua);
   free_bsr(rx.bsr_list);
   jcr->needs_sd = true;
   return jcr->ExpectedFiles;

bail_out:
   free_ua_context(ua);
   free_bsr(rx.bsr_list);
   return files;
}
/*
 * Given: a JobId  and FileIndex
 *  this subroutine writes a bsr file to restore that job.
 * Returns: -1 on error
 *           number of files if OK
 */
a JobId  and FileIndex
this subroutine writes a bsr file to restore that job.
Returns: -1 on error
number of files if OK
a JobId and FileIndex this subroutine writes a bsr file to restore that job . Returns : - 1 on error number of files if OK
int create_restore_bootstrap_file(JCR *jcr, JobId_t jobid, int findex1, int findex2)
{
   RESTORE_CTX rx;
   UAContext *ua;
   int files;
   memset(&rx, 0, sizeof(rx));
   rx.JobIds = (char *)"";
   rx.bsr_list = create_bsr_list(jobid, findex1, findex2);
   ua = new_ua_context(jcr);
   if (!complete_bsr(ua, rx.bsr_list)) {
      files = -1;
      goto bail_out;
   }
   jcr->ExpectedFiles = write_bsr_file(ua, rx);
   if (jcr->ExpectedFiles == 0) {
      files = 0;
      goto bail_out;
   }
   free_ua_context(ua);
   free_bsr(rx.bsr_list);
   jcr->needs_sd = true;
   return jcr->ExpectedFiles;
bail_out:
   free_ua_context(ua);
   free_bsr(rx.bsr_list);
   return files;
}
int create_restore_bootstrap_file ( JCR * jcr , JobId_t jobid , int findex1 , int findex2 ) { RESTORE_CTX rx ; UAContext * ua ; int files ; memset ( & rx , 0 , sizeof ( rx ) ) ; rx . JobIds = ( char * ) " " ; rx . bsr_list = create_bsr_list ( jobid , findex1 , findex2 ) ; ua = new_ua_context ( jcr ) ; if ( ! complete_bsr ( ua , rx . bsr_list ) ) { files = -1 ; goto bail_out ; } jcr -> ExpectedFiles = write_bsr_file ( ua , rx ) ; if ( jcr -> ExpectedFiles == 0 ) { files = 0 ; goto bail_out ; } free_ua_context ( ua ) ; free_bsr ( rx . bsr_list ) ; jcr -> needs_sd = true ; return jcr -> ExpectedFiles ; bail_out : free_ua_context ( ua ) ; free_bsr ( rx . bsr_list ) ; return files ; }
Given: a JobId  and FileIndex
  this subroutine writes a bsr file to restore that job.
Given : a JobId and FileIndex this subroutine writes a bsr file to restore that job .