From 9793faecbe14b0f2116324901eed51380be0e0f5 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 27 Apr 2004 09:40:57 +0000 Subject: [PATCH] Fix win32 wx-console stdout crash git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1315 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/lib/message.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index a5407b0ea4..fe7ddfaa38 100755 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -205,7 +205,9 @@ init_msg(JCR *jcr, MSGS *msg) daemon_msgs = (MSGS *)malloc(sizeof(MSGS)); memset(daemon_msgs, 0, sizeof(MSGS)); for (i=1; i<=M_MAX; i++) { +#ifndef WIN32 add_msg_dest(daemon_msgs, MD_STDOUT, i, NULL, NULL); +#endif add_msg_dest(daemon_msgs, MD_SYSLOG, i, NULL, NULL); } Dmsg1(050, "Create daemon global message resource 0x%x\n", daemon_msgs); @@ -560,8 +562,10 @@ void dispatch_message(JCR *jcr, int type, int level, char *msg) Dmsg2(800, "Enter dispatch_msg type=%d msg=%s\n", type, msg); if (type == M_ABORT || type == M_ERROR_TERM) { +#ifndef HAVE_WIN32 fputs(msg, stdout); /* print this here to INSURE that it is printed */ fflush(stdout); +#endif #if !defined(HAVE_CONSOLE) #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32) MessageBox(NULL, msg, "Bacula", MB_OK); -- 2.39.5