changeset 5349:0c9cfac8119a HEAD

When marking transaction log corrupted, set indexid=0 instead of version=0. Version setting worked too, but indexid=0 makes it log a "marked corrupted" error message.
author Timo Sirainen <tss@iki.fi>
date Fri, 16 Mar 2007 18:02:26 +0200
parents 7ca3a28d3191
children d8de9ddaf9cb
files src/lib-index/mail-transaction-log.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-transaction-log.c	Fri Mar 16 17:44:59 2007 +0200
+++ b/src/lib-index/mail-transaction-log.c	Fri Mar 16 18:02:26 2007 +0200
@@ -53,7 +53,9 @@
 	file->hdr.indexid = 0;
 	if (!MAIL_TRANSACTION_LOG_FILE_IN_MEMORY(file)) {
 		if (pwrite_full(file->fd, &file->hdr.indexid,
-				sizeof(file->hdr.indexid), 0) < 0) {
+				sizeof(file->hdr.indexid),
+				offsetof(struct mail_transaction_log_header,
+					 indexid)) < 0) {
 			mail_index_file_set_syscall_error(file->log->index,
 				file->filepath, "pwrite()");
 		}