]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/label.c
kes Apply patch supplied in bug #656 to pass priority field
[bacula/bacula] / bacula / src / stored / label.c
index b51ec456618c677baa8f41d436ba309d26279887..59a2380e8947b999238ea8c610ec4ab7f833db37 100644 (file)
@@ -399,6 +399,9 @@ bool rewrite_volume_label(DCR *dcr, bool recycle)
       Dmsg0(200, "Error from write volume label.\n");
       return false;
    }
+
+   dev->VolCatInfo.VolCatBytes = 0;        /* reset byte count */
+
    /*
     * If we are not dealing with a streaming device,
     *  write the block now to ensure we have write permission.
@@ -446,7 +449,6 @@ bool rewrite_volume_label(DCR *dcr, bool recycle)
    /* Set or reset Volume statistics */
    dev->VolCatInfo.VolCatJobs = 0;
    dev->VolCatInfo.VolCatFiles = 0;
-   dev->VolCatInfo.VolCatBytes = 1;
    dev->VolCatInfo.VolCatErrors = 0;
    dev->VolCatInfo.VolCatBlocks = 0;
    dev->VolCatInfo.VolCatRBytes = 0;
@@ -558,7 +560,7 @@ void create_volume_label(DEVICE *dev, const char *VolName,
 
    bstrncpy(dev->VolHdr.Id, BaculaId, sizeof(dev->VolHdr.Id));
    dev->VolHdr.VerNum = BaculaTapeVersion;
-   if (dev->is_dvd()) {
+   if (dev->is_dvd() && dvdnow) {
       /* We do not want to re-label a DVD so write VOL_LABEL now */
       dev->VolHdr.LabelType = VOL_LABEL;
    } else {