]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/message.c
- Put Dmsg() on inside if() to avoid calling subroutine.
[bacula/bacula] / bacula / src / lib / message.c
index d86280278cfbd0f9cdefb03eb5bea9f62fe6e23f..8151ccd28dbe9d1f594e128e9bbaac127e2ae759 100755 (executable)
@@ -6,28 +6,23 @@
  *   Version $Id$
  *
  */
-
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as ammended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
 
+
 #include "bacula.h"
 #include "jcr.h"
 
@@ -91,8 +86,6 @@ static bool trace = false;
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 static MSGS *daemon_msgs;             /* global messages */
 
-/* Define if e_msg must exit when M_ERROR_TERM is received */
-static int exit_on_error = 1;
 
 /*
  * Set daemon name. Also, find canonical execution
@@ -570,7 +563,7 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
     MSGS *msgs;
     BPIPE *bpipe;
 
-    Dmsg2(850, "Enter dispatch_msg type=%d msg=%s\n", type, msg);
+    Dmsg2(850, "Enter dispatch_msg type=%d msg=%s", type, msg);
 
     /*
      * Most messages are prefixed by a date and time. If mtime is
@@ -596,14 +589,6 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
        fputs(dt, stdout);
        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)
-       /* If we don't exit on error, error messages are parsed by UA */
-       if (exit_on_error) {
-          MessageBox(NULL, msg, "Bacula", MB_OK);
-       }
-#endif
 #endif
     }
 
@@ -770,10 +755,10 @@ d_msg(const char *file, int line, int level, const char *fmt,...)
     char      buf[5000];
     int       len;
     va_list   arg_ptr;
-    int       details = TRUE;
+    bool      details = true;
 
     if (level < 0) {
-       details = FALSE;
+       details = false;
        level = -level;
     }
 
@@ -982,7 +967,7 @@ e_msg(const char *file, int line, int type, int level, const char *fmt,...)
        char *p = 0;
        p[0] = 0;                     /* generate segmentation violation */
     }
-    if ((type == M_ERROR_TERM) && exit_on_error) {
+    if (type == M_ERROR_TERM) {
        exit(1);
     }
 }
@@ -1079,7 +1064,7 @@ Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
        char *p = 0;
        p[0] = 0;                     /* generate segmentation violation */
     }
-    if ((type == M_ERROR_TERM) && exit_on_error) {
+    if (type == M_ERROR_TERM) {
        exit(1);
     }
 }
@@ -1316,10 +1301,3 @@ void q_msg(const char *file, int line, JCR *jcr, int type, time_t mtime, const c
    Qmsg(jcr, type, mtime, "%s", pool_buf);
    free_memory(pool_buf);
 }
-
-/*
- * Define if e_msg must exit when M_ERROR_TERM is received
- */
-void set_exit_on_error(int value) {
-   exit_on_error = value;
-}