From 3a320680d84f6a87c265d0ac43220e1083efb644 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 23 Oct 2017 18:39:36 +0200 Subject: [PATCH] Fix bug 2323 -- loop exit condition was backward and add error message --- bacula/src/stored/askdir.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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. -- 2.39.5