From: Nicolas Boichat Date: Thu, 28 Jul 2005 15:14:30 +0000 (+0000) Subject: Fix when we cannot mount the DVD, but no part has yet been written. X-Git-Tag: Release-1.38.0~239 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=44833a22ac4819272e3d8b0f48a2a50856a2bfaf;p=bacula%2Fbacula Fix when we cannot mount the DVD, but no part has yet been written. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2265 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 617d077416..ff71eecb0d 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -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());