dovecot-2.2: lib-index: Give a better error message if index is ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Feb 19 13:43:54 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/d40e3bf2de89
changeset: 15850:d40e3bf2de89
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Feb 19 13:43:42 2013 +0200
description:
lib-index: Give a better error message if index is readonly and log is tried to be locked.

diffstat:

 src/lib-index/mail-transaction-log-file.c |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r d977a746819d -r d40e3bf2de89 src/lib-index/mail-transaction-log-file.c
--- a/src/lib-index/mail-transaction-log-file.c	Tue Feb 19 13:18:38 2013 +0200
+++ b/src/lib-index/mail-transaction-log-file.c	Tue Feb 19 13:43:42 2013 +0200
@@ -362,6 +362,13 @@
 	if (file->log->index->lock_method == FILE_LOCK_METHOD_DOTLOCK)
 		return mail_transaction_log_file_dotlock(file);
 
+	if (file->log->index->readonly) {
+		mail_index_set_error(file->log->index,
+			"Index is read-only, can't write-lock %s",
+			file->filepath);
+		return -1;
+	}
+
 	i_assert(file->file_lock == NULL);
 	lock_timeout_secs = I_MIN(MAIL_TRANSACTION_LOG_LOCK_TIMEOUT,
 				  file->log->index->max_lock_timeout_secs);


More information about the dovecot-cvs mailing list