]> git.sur5r.net Git - bacula/bacula/commitdiff
- Fix "unknown device type" problem with DVD devices.
authorNicolas Boichat <nicolas@boichat.ch>
Thu, 7 Apr 2005 13:09:24 +0000 (13:09 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Thu, 7 Apr 2005 13:09:24 +0000 (13:09 +0000)
 - Fix crash when there is no media in the DVD drive.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1915 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/dev.c
bacula/src/stored/dvd.c
bacula/src/stored/label.c

index bad6ba545e19e357522baa41cadfde94bb477ac7..6ddcdf162e293ed54a0004d0dfe0b94694bac014 100644 (file)
@@ -136,7 +136,7 @@ init_dev(JCR *jcr, DEVICE *dev, DEVRES *device)
       tape = true;
    } else if (S_ISFIFO(statp.st_mode)) {
       fifo = true;
-   } else {
+   } else if (!(device->cap_bits & CAP_REQMOUNT)) {
       if (dev) {
         dev->dev_errno = ENODEV;
       }
index 47a7ba2bb989dda050a278d203fc564cc9aedbfd..7aeae4d7e8b4423aee7c444b6348e2c01aba4c3c 100644 (file)
@@ -209,9 +209,8 @@ int open_guess_name_dev(DEVICE *dev)
          Dmsg1(100, "open_guess_name_dev: device cannot be mounted, but it seems to be writable, returning 0. dev=%s\n", dev->dev_name);
          return 0;
       } else {
-         Dmsg1(100, "open_guess_name_dev: device cannot be mounted, and is not writable, returning 0. dev=%s\n", dev->dev_name);
-         /* read_dev_volume_label_guess must now check dev->free_space_errno to understand that the media is not writable. */
-         return 0;
+         Dmsg1(100, "open_guess_name_dev: device cannot be mounted, and is not writable, returning -1. dev=%s\n", dev->dev_name);
+         return -1;
       }
    }
       
index 9ac06c2cea95f98c98337ea12810a6b02be8cd2f..9e7e762891e89fcc054dc542f318312a533c4a06 100644 (file)
@@ -258,7 +258,7 @@ int read_dev_volume_label_guess(DCR *dcr, bool write)
       if (!write || dcr->VolCatInfo.VolCatParts > 0) {
          Mmsg2(jcr->errmsg, _("Requested Volume \"%s\" on %s is not a Bacula labeled Volume."),
               dev->print_name(), dcr->VolumeName);
-         Dmsg0(100, "Leave read_dev_volume_label_guess VOL_IO_ERROR (!open_guess_name_dev)\n");
+         Dmsg0(100, "Leave read_dev_volume_label_guess VOL_NO_LABEL (!open_guess_name_dev)\n");
         return VOL_NO_LABEL;
       }