Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8117:079ed76a987d HEAD
If logging failed to info log, try to log a failure to error log if it's elsewhere.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 29 Aug 2008 09:43:18 +0300 |
parents | 827c3a3a1627 |
children | 6665a641780c |
files | src/lib/failures.c |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/failures.c Thu Aug 28 13:54:30 2008 +0300 +++ b/src/lib/failures.c Fri Aug 29 09:43:18 2008 +0300 @@ -90,6 +90,7 @@ } if (ret == 0) { /* out of disk space? */ + errno = ENOSPC; return -1; } if (errno != EAGAIN) @@ -166,8 +167,14 @@ int fd = type == LOG_TYPE_INFO ? log_info_fd : log_fd; if (default_handler(failure_log_type_prefixes[type], - fd, format, args) < 0) - failure_exit(FATAL_LOGWRITE); + fd, format, args) < 0) { + if (fd == log_fd) + failure_exit(FATAL_LOGWRITE); + /* we failed to log to info log, try to log the write error + to error log - maybe that'll work. */ + i_fatal_status(FATAL_LOGWRITE, + "write() failed to info log: %m"); + } } void i_log_type(enum log_type type, const char *format, ...)