]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/job.c
kes Ensure that when labelling a tape with Slot=0 that InChanger
[bacula/bacula] / bacula / src / dird / job.c
index bd0be764f82ba27438943b1363c4582f7c2642cf..c4f3ca13566e328f61dc89c71e2fab4330d671cd 100644 (file)
@@ -213,6 +213,7 @@ bool setup_job(JCR *jcr)
    }
 
    generate_job_event(jcr, "JobInit");
+   Dsm_check(1);
    return true;
 
 bail_out:
@@ -238,7 +239,7 @@ static void *job_thread(void *arg)
 
    jcr->my_thread_id = pthread_self();
    pthread_detach(jcr->my_thread_id);
-   sm_check(__FILE__, __LINE__, true);
+   Dsm_check(1);
 
    Dmsg0(200, "=====Start Job=========\n");
    set_jcr_job_status(jcr, JS_Running);   /* this will be set only if no error */
@@ -440,6 +441,7 @@ static void job_monitor_watchdog(watchdog_t *self)
 
    control_jcr = (JCR *)self->data;
 
+   Dsm_check(1);
    Dmsg1(800, "job_monitor_watchdog %p called\n", self);
 
    foreach_jcr(jcr) {
@@ -802,14 +804,14 @@ void dird_free_jcr(JCR *jcr)
       pthread_cond_destroy(&jcr->term_wait);
       jcr->term_wait_inited = false;
    }
+   if (jcr->db_batch && jcr->db_batch != jcr->db) {
+      db_close_database(jcr, jcr->db_batch);
+   }
+   jcr->db_batch = NULL;
    if (jcr->db) {
       db_close_database(jcr, jcr->db);
       jcr->db = NULL;
    }
-   if (jcr->db_batch) {
-      db_close_database(jcr, jcr->db_batch);
-      jcr->db_batch = NULL;
-   }
    if (jcr->stime) {
       Dmsg0(200, "Free JCR stime\n");
       free_pool_memory(jcr->stime);