]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/backup.c
Massive SD calling sequence reorganization
[bacula/bacula] / bacula / src / dird / backup.c
index 623755c7fdb8025e32312675053b4882a8742f54..9f7d07c7a90dc9bd8842c92638546229742dc19c 100644 (file)
@@ -67,6 +67,7 @@ int do_backup(JCR *jcr)
    BSOCK   *fd;
    POOL_DBR pr;
    FILESET_DBR fsr;
+   STORE *store;
 
    since[0] = 0;
 
@@ -80,7 +81,7 @@ int do_backup(JCR *jcr)
 
    get_level_since_time(jcr, since, sizeof(since));
 
-   jcr->fname = (char *)get_pool_memory(PM_FNAME);
+   jcr->fname = get_pool_memory(PM_FNAME);
 
    /* 
     * Get the Pool record -- first apply any level defined pools  
@@ -182,11 +183,12 @@ int do_backup(JCR *jcr)
    /* 
     * send Storage daemon address to the File daemon
     */
-   if (jcr->store->SDDport == 0) {
-      jcr->store->SDDport = jcr->store->SDport;
+   store = (STORE *)jcr->storage[0]->first();
+   if (store->SDDport == 0) {
+      store->SDDport = store->SDport;
    }
-   bnet_fsend(fd, storaddr, jcr->store->address, jcr->store->SDDport,
-             jcr->store->enable_ssl);
+   bnet_fsend(fd, storaddr, store->address, store->SDDport,
+             store->enable_ssl);
    if (!response(jcr, fd, OKstore, "Storage", DISPLAY_ERROR)) {
       goto bail_out;
    }
@@ -293,6 +295,7 @@ static void backup_cleanup(JCR *jcr, int TermCode, char *since, FILESET_DBR *fsr
    utime_t RunTime;
 
    Dmsg2(100, "Enter backup_cleanup %d %c\n", TermCode, TermCode);
+   dequeue_messages(jcr);            /* display any queued messages */
    memset(&mr, 0, sizeof(mr));
    set_jcr_job_status(jcr, TermCode);