]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/dircmd.c
Update the Microsoft Visual Studio build to match the MinGW32 build.
[bacula/bacula] / bacula / src / stored / dircmd.c
index 7a22f56521a2b83a946c47a13e7f0366c4692280..877b4b01b2cfc66c6ee3a12c70a09abb35e57ec4 100644 (file)
@@ -43,8 +43,6 @@
 extern BSOCK *filed_chan;
 extern int r_first, r_last;
 extern struct s_res resources[];
-extern char my_name[];
-extern time_t daemon_start_time;
 extern struct s_last_job last_job;
 extern bool init_done;
 
@@ -392,6 +390,7 @@ static void label_volume_if_ok(DCR *dcr, char *oldname,
    DEVICE *dev = dcr->dev;
    int label_status;
    int mode;
+   const char *volname = (relabel == 0) ? newname : oldname;
 
    steal_device_lock(dev, &hold, BST_WRITING_LABEL);
    Dmsg1(100, "Stole device %s lock, writing label.\n", dev->print_name());
@@ -401,7 +400,7 @@ static void label_volume_if_ok(DCR *dcr, char *oldname,
       dcr->VolCatInfo.VolCatParts=1;
    }
 
-   if (!try_autoload_device(dcr->jcr, slot, (relabel == 0) ? newname : oldname)) {
+   if (!try_autoload_device(dcr->jcr, slot, volname)) {
       goto bail_out;                  /* error */
    }
 
@@ -411,6 +410,10 @@ static void label_volume_if_ok(DCR *dcr, char *oldname,
    } else {
       mode = CREATE_READ_WRITE;
    }
+   if (dev->is_dvd()) {
+      bstrncpy(dcr->VolCatInfo.VolCatName, volname, sizeof(dcr->VolCatInfo.VolCatName));
+   }
+
    if (dev->open(dcr, mode) < 0) {
       bnet_fsend(dir, _("3910 Unable to open device %s: ERR=%s\n"),
          dev->print_name(), dev->strerror());