From: Kern Sibbald Date: Fri, 12 Feb 2010 11:01:22 +0000 (+0100) Subject: Fix bug #1501 -t does not print errors X-Git-Tag: Release-7.0.0~2233 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5978ea864154181f39a5eb26b01263a84eb2fb17;p=bacula%2Fbacula Fix bug #1501 -t does not print errors --- diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index bfeb8295b3..9696779926 100644 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -675,6 +675,17 @@ void dispatch_message(JCR *jcr, int type, utime_t mtime, char *msg) return; } + /* For serious errors make sure message is printed or logged */ + if (type == M_ABORT || type == M_ERROR_TERM) { + fputs(dt, stdout); + fputs(msg, stdout); + fflush(stdout); + if (type == M_ABORT) { + syslog(LOG_DAEMON|LOG_ERR, "%s", msg); + } + } + + /* Now figure out where to send the message */ msgs = NULL; if (!jcr) {