]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Removed LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL. It's no longer necessary.
authorTimo Sirainen <tss@iki.fi>
Tue, 5 May 2009 00:30:03 +0000 (20:30 -0400)
committerTimo Sirainen <tss@iki.fi>
Tue, 5 May 2009 00:30:03 +0000 (20:30 -0400)
--HG--
branch : HEAD

src/lib/failures.c
src/lib/failures.h
src/master/service-process.c

index d73491d799332e945ba3138d64aec730956c671d..98357b37da4e577ff887cf405b58d2a35c4e9b13 100644 (file)
@@ -21,8 +21,7 @@ const char *failure_log_type_prefixes[LOG_TYPE_COUNT] = {
        "Warning: ",
        "Error: ",
        "Fatal: ",
-       "Panic: ",
-       "Error: "
+       "Panic: "
 };
 
 /* Initialize working defaults */
@@ -195,22 +194,6 @@ void i_log_type(enum log_type type, const char *format, ...)
 
        va_start(args, format);
 
-       if (type == LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL &&
-           error_handler != i_internal_error_handler) {
-               /* this is handled specially only by internal logging.
-                  skip over the pid. */
-               T_BEGIN {
-                       const char *str;
-
-                       str = t_strdup_vprintf(format, args);
-                       while (*str >= '0' && *str <= '9') str++;
-                       if (*str == ' ') str++;
-
-                       i_error("%s", str);
-               } T_END;
-               return;
-       }
-
        if (type == LOG_TYPE_INFO)
                info_handler(type, format, args);
        else
@@ -346,7 +329,6 @@ void i_syslog_error_handler(enum log_type type, const char *fmt, va_list args)
                level = LOG_WARNING;
                break;
        case LOG_TYPE_ERROR:
-       case LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL:
                level = LOG_ERR;
                break;
        case LOG_TYPE_FATAL:
index ebef298492acec44f266b8235c96aa110e902e28..609f9df2379d7c6a57674ab456b8e4e3890491c4 100644 (file)
@@ -21,11 +21,6 @@ enum log_type {
        LOG_TYPE_FATAL,
        LOG_TYPE_PANIC,
 
-       /* Special message from master to log process: Log message begins with
-          "<pid> " and if <pid> has already logged a fatal/panic, this message
-          shouldn't be written to the log. Otherwise log as an error. */
-       LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL,
-
        LOG_TYPE_COUNT,
        LOG_TYPE_OPTION
 };
index ae56a9aa28143afbb232d6fcb473c6daecd9316c..c33cc54b32f42552a147ba07c103e5367bf546af 100644 (file)
@@ -557,12 +557,12 @@ static void log_coredump(struct service *service, string_t *str, int status)
 
 static void
 service_process_get_status_error(string_t *str, struct service_process *process,
-                                int status, enum log_type *type_r)
+                                int status, bool *default_fatal_r)
 {
        struct service *service = process->service;
        const char *msg;
 
-       *type_r = LOG_TYPE_ERROR;
+       *default_fatal_r = FALSE;
 
        str_printfa(str, "service(%s): child %s ", service->set->name,
                    dec2str(process->pid));
@@ -588,17 +588,16 @@ service_process_get_status_error(string_t *str, struct service_process *process,
                str_printfa(str, " (%s)", msg);
 
        if (status == FATAL_DEFAULT)
-               *type_r = LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL;
+               *default_fatal_r = TRUE;
 }
 
 static void service_process_log(struct service_process *process,
-                               enum log_type type, const char *str)
+                               bool default_fatal, const char *str)
 {
        const char *data;
 
-       if (type != LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL ||
-           process->service->log_fd[1] == -1) {
-               i_log_type(type, "%s", str);
+       if (!default_fatal || process->service->log_fd[1] == -1) {
+               i_error("%s", str);
                return;
        }
 
@@ -623,10 +622,11 @@ void service_process_log_status_error(struct service_process *process,
        }
        T_BEGIN {
                string_t *str = t_str_new(256);
-               enum log_type type;
+               bool default_fatal;
 
-               service_process_get_status_error(str, process, status, &type);
+               service_process_get_status_error(str, process, status,
+                                                &default_fatal);
                if (str_len(str) > 0)
-                       service_process_log(process, type, str_c(str));
+                       service_process_log(process, default_fatal, str_c(str));
        } T_END;
 }