]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/reserve.c
Make cd accept wildcards
[bacula/bacula] / bacula / src / stored / reserve.c
index df0d1e5562de3b829287b97c64334fa727588edd..a40be1607ad68ec6498246f86bcab48726946de9 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -180,9 +180,9 @@ static bool use_device_cmd(JCR *jcr)
 {
    POOL_MEM store_name, dev_name, media_type, pool_name, pool_type;
    BSOCK *dir = jcr->dir_bsock;
-   int append;
+   int32_t append;
    bool ok;       
-   int Copy, Stripe;
+   int32_t Copy, Stripe;
    DIRSTORE *store;
    RCTX rctx;
    alist *dirstore;
@@ -235,6 +235,7 @@ static bool use_device_cmd(JCR *jcr)
       }
    }  while (ok && dir->recv() >= 0);
 
+#ifdef xxxx
    /* Developer debug code */
    char *device_name;
    if (debug_level >= dbglvl) {
@@ -247,6 +248,7 @@ static bool use_device_cmd(JCR *jcr)
          }
       }
    }
+#endif
 
    init_jcr_device_wait_timers(jcr);
    jcr->dcr = new_dcr(jcr, NULL, NULL);         /* get a dcr */
@@ -271,6 +273,12 @@ static bool use_device_cmd(JCR *jcr)
       bool fail = false;
       rctx.notify_dir = true;
 
+      /* Put new dcr in proper location */
+      if (rctx.append) {
+         rctx.jcr->dcr = jcr->dcr;
+      } else {
+         rctx.jcr->read_dcr = jcr->dcr;
+      }
       lock_reservations();
       for ( ; !fail && !job_canceled(jcr); ) {
          pop_reserve_messages(jcr);