src/dird/job.c
JobId_t run_job(JCR *jcr)
{
   int stat;
   if (setup_job(jcr)) {
      Dmsg0(200, "Add jrc to work queue\n");
      /* Queue the job to be run */
      if ((stat = jobq_add(&job_queue, jcr)) != 0) {
         berrno be;
         Jmsg(jcr, M_FATAL, 0, _("Could not add job queue: ERR=%s\n"), be.bstrerror(stat));
         return 0;
      }
      return jcr->JobId;
   }
   return 0;
}
/*
 * Run a job -- typically called by the scheduler, but may also
 *              be called by the UA (Console program).
 *
 *  Returns: 0 on failure
 *           JobId on success
 *
 */
Run a job -- typically called by the scheduler, but may also
be called by the UA (Console program).

0 on failure
JobId on success
Run a job -- typically called by the scheduler but may also be called by the UA ( Console program ) . 0 on failure JobId on success
JobId_t run_job(JCR *jcr)
{
   int stat;
   if (setup_job(jcr)) {
      Dmsg0(200, "Add jrc to work queue\n");
      if ((stat = jobq_add(&job_queue, jcr)) != 0) {
         berrno be;
         Jmsg(jcr, M_FATAL, 0, _("Could not add job queue: ERR=%s\n"), be.bstrerror(stat));
         return 0;
      }
      return jcr->JobId;
   }
   return 0;
}
JobId_t run_job ( JCR * jcr ) { int stat ; if ( setup_job ( jcr ) ) { Dmsg0 ( 200 , " \n " ) ; if ( ( stat = jobq_add ( & job_queue , jcr ) ) != 0 ) { berrno be ; Jmsg ( jcr , M_FATAL , 0 , _ ( " \n " ) , be . bstrerror ( stat ) ) ; return 0 ; } return jcr -> JobId ; } return 0 ; }
Run a job -- typically called by the scheduler, but may also
              be called by the UA (Console program).
Run a job -- typically called by the scheduler but may also be called by the UA ( Console program ) .
/* Queue the job to be run */