]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix bug 2323 -- loop exit condition was backward and add error message
authorKern Sibbald <kern@sibbald.com>
Mon, 23 Oct 2017 16:39:36 +0000 (18:39 +0200)
committerKern Sibbald <kern@sibbald.com>
Mon, 23 Oct 2017 16:39:36 +0000 (18:39 +0200)
bacula/src/stored/askdir.c

index 136f5367375dee1d9e434940ab396f1828e42782..b03c5d927d512f504994c119fa29fb4a4193a525 100644 (file)
@@ -878,7 +878,15 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr, bool write_access)
       return false;
    }
 
-   for ( ; job_canceled(jcr); ) {
+   for ( ;; ) {
+      if (job_canceled(jcr)) {
+         Mmsg(dev->errmsg,
+              _("Job %s canceled while waiting for mount on Storage Device \"%s\".\n"),
+              jcr->Job, dev->print_name());
+         Jmsg(jcr, M_INFO, 0, "%s", dev->errmsg);
+         dev->poll = false;
+         return false;
+      }
       /*
        * If we are not polling, and the wait timeout or the
        *   user explicitly did a mount, send him the message.