From: Kern Sibbald Date: Mon, 23 Oct 2017 16:39:36 +0000 (+0200) Subject: Fix bug 2323 -- loop exit condition was backward and add error message X-Git-Tag: Release-9.0.5~37 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3a320680d84f6a87c265d0ac43220e1083efb644;p=bacula%2Fbacula Fix bug 2323 -- loop exit condition was backward and add error message --- diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index 136f536737..b03c5d927d 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -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.