]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix when we cannot mount the DVD, but no part has yet been written.
authorNicolas Boichat <nicolas@boichat.ch>
Thu, 28 Jul 2005 15:14:30 +0000 (15:14 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Thu, 28 Jul 2005 15:14:30 +0000 (15:14 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2265 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/dev.c

index 617d077416711e60767c206095842674be5c6b65..ff71eecb0dfc74e53c6339e2845ddc69a59fcc34 100644 (file)
@@ -497,7 +497,16 @@ void DEVICE::open_dvd_device(DCR *dcr, int omode)
       /* We cannot mount the device */
       if (num_parts == 0) {
          /* Run free space, check there is a media. */
-         Dmsg1(29, "Could not mount device %s, this is not a problem (num_parts == 0).\n", print_name());
+         update_free_space_dev(this);
+         if (have_media()) {
+            Dmsg1(29, "Could not mount device %s, this is not a problem (num_parts == 0), and have media.\n", print_name());
+         }
+         else {
+            Mmsg(errmsg, _("There is no valid media in the device %s.\n"), print_name());
+            Emsg0(M_FATAL, 0, errmsg);
+            fd = -1;
+            return;
+         }
       }
       else {
          Mmsg(errmsg, _("Could not mount device %s.\n"), print_name());