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-5.2.1~1768 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a839a2f7765735ec1ccc79d2d49ca10abe84e1a7;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) {