# HG changeset patch # User Timo Sirainen # Date 1241483403 14400 # Node ID b57e1c3ea3f7c26cd367c13b72d66aa36dd479b5 # Parent 7def7fa61d6864225dbe359f54691c06bcedc941 Removed LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL. It's no longer necessary. diff -r 7def7fa61d68 -r b57e1c3ea3f7 src/lib/failures.c --- a/src/lib/failures.c Mon May 04 20:24:57 2009 -0400 +++ b/src/lib/failures.c Mon May 04 20:30:03 2009 -0400 @@ -21,8 +21,7 @@ "Warning: ", "Error: ", "Fatal: ", - "Panic: ", - "Error: " + "Panic: " }; /* Initialize working defaults */ @@ -195,22 +194,6 @@ 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 @@ level = LOG_WARNING; break; case LOG_TYPE_ERROR: - case LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL: level = LOG_ERR; break; case LOG_TYPE_FATAL: diff -r 7def7fa61d68 -r b57e1c3ea3f7 src/lib/failures.h --- a/src/lib/failures.h Mon May 04 20:24:57 2009 -0400 +++ b/src/lib/failures.h Mon May 04 20:30:03 2009 -0400 @@ -21,11 +21,6 @@ LOG_TYPE_FATAL, LOG_TYPE_PANIC, - /* Special message from master to log process: Log message begins with - " " and if 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 }; diff -r 7def7fa61d68 -r b57e1c3ea3f7 src/master/service-process.c --- a/src/master/service-process.c Mon May 04 20:24:57 2009 -0400 +++ b/src/master/service-process.c Mon May 04 20:30:03 2009 -0400 @@ -557,12 +557,12 @@ 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 @@ 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 @@ } 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; }