]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/dev.c
Correct dvd code that breaks tape labeling
[bacula/bacula] / bacula / src / stored / dev.c
index 920a4ea01e9311531047dd42eca92f968259c5bf..2ba6fa455f48a577a46c29c7f47166cfd7898246 100644 (file)
@@ -526,8 +526,7 @@ void DEVICE::open_dvd_device(DCR *dcr, int omode)
      
    if (mount_dvd(this, 1)) {
       Dmsg0(99, "DVD device mounted.\n");
-      if ((num_dvd_parts == 0) && (!truncating)) {
-#ifdef needed
+      if (num_dvd_parts == 0 && !truncating) {
          /*
           * If we can mount the device, and we are not truncating the DVD, 
           * we usually want to abort. There is one exception, if there is 
@@ -541,7 +540,6 @@ void DEVICE::open_dvd_device(DCR *dcr, int omode)
             clear_opened();
             return;
          }
-#endif
          truncated_dvd = true;
       }
    } else {
@@ -1785,12 +1783,12 @@ void DEVICE::close()
       int status;
 
       part = num_dvd_parts;
-      Dmsg3(100, "Remove empty part in close call make_dvd_filename. part=%d num=%d vol=%s\n", 
-         part, num_dvd_parts, VolCatInfo.VolCatName);
       make_spooled_dvd_filename(this, archive_name);
       /* Check that the part file is empty */
       status = stat(archive_name.c_str(), &statp);
       if (status == 0 && statp.st_size == 0) {
+         Dmsg3(100, "Unlink empty part in close call make_dvd_filename. part=%d num=%d vol=%s\n", 
+                part, num_dvd_parts, VolCatInfo.VolCatName);
          Dmsg1(100, "unlink(%s)\n", archive_name.c_str());
          unlink(archive_name.c_str());
          set_part_spooled(false);        /* no spooled part left */