changeset 5234:f107ddd56550 HEAD

Don't crash when rotating locked in-memory log file.
author Timo Sirainen <tss@iki.fi>
date Wed, 07 Mar 2007 02:42:32 +0200
parents 359a8f31aa9b
children 660763f5e75a
files src/lib-index/mail-transaction-log.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-transaction-log.c	Wed Mar 07 02:14:44 2007 +0200
+++ b/src/lib-index/mail-transaction-log.c	Wed Mar 07 02:42:32 2007 +0200
@@ -879,9 +879,10 @@
 
 	i_assert(log->head->locked);
 
-	if (MAIL_INDEX_IS_IN_MEMORY(log->index))
+	if (MAIL_INDEX_IS_IN_MEMORY(log->index)) {
 		file = mail_transaction_log_file_alloc_in_memory(log);
-	else {
+		file->locked = TRUE;
+	} else {
                 /* we're locked, we shouldn't need to worry about ESTALE
                    problems in here. */
 		if (fstat(log->head->fd, &st) < 0) {