From: Michal Rakowski Date: Wed, 27 Jan 2021 11:41:09 +0000 (+0100) Subject: Allow to set 0 as Maximum Job Error Count X-Git-Tag: Release-11.3.2~768 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44f203298dd6e51b1e427a1edadc55a87f88e552;p=thirdparty%2Fbacula.git Allow to set 0 as Maximum Job Error Count This allows job to run no matter how many error there is. --- diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index d5a58a8af..7fae57176 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -713,7 +713,8 @@ finish_sending: berrno be; Jmsg(jcr, M_ERROR, 0, _("Read error on file %s. ERR=%s\n"), bctx.ff_pkt->snap_fname, be.bstrerror(bctx.ff_pkt->bfd.berrno)); - if (jcr->JobErrors++ > me->max_job_errors) { /* insanity check */ + /* It's possible for user to set max job errors to 0 as an infinite value */ + if (me->max_job_errors && (jcr->JobErrors++ > me->max_job_errors)) { /* insanity check */ Jmsg(jcr, M_FATAL, 0, _("Too many errors. JobErrors=%d.\n"), jcr->JobErrors); } } else if (bctx.ff_pkt->flags & FO_ENCRYPT) {