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.0.1~95 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9f2242b40207ea334e95823266b7a02ee1254a4d;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) {