changeset 2192:d7378b25046b HEAD

Expunge fixes
author Timo Sirainen <tss@iki.fi>
date Sun, 20 Jun 2004 07:18:12 +0300
parents 4d25f3fe5de1
children 1019b7694a11
files src/lib-storage/index/mbox/mbox-mail.c src/lib-storage/index/mbox/mbox-sync.c
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-mail.c	Sun Jun 20 07:17:42 2004 +0300
+++ b/src/lib-storage/index/mbox/mbox-mail.c	Sun Jun 20 07:18:12 2004 +0300
@@ -17,6 +17,7 @@
 	struct index_mailbox *ibox = mail->ibox;
 	const void *data;
 	uint64_t offset;
+	int ret;
 
 	if (ibox->mbox_lock_type == F_UNLCK) {
 		if (mbox_sync(ibox, FALSE, FALSE, TRUE) < 0)
@@ -29,9 +30,11 @@
 	if (mbox_file_open_stream(ibox) < 0)
 		return -1;
 
-	if (mail_index_lookup_extra(ibox->view, mail->mail.seq,
-				    ibox->mbox_extra_idx, &data) < 0) {
-		mail_storage_set_index_error(ibox);
+	ret = mail_index_lookup_extra(ibox->view, mail->mail.seq,
+				      ibox->mbox_extra_idx, &data);
+	if (ret <= 0) {
+		if (ret < 0)
+			mail_storage_set_index_error(ibox);
 		return -1;
 	}
 
--- a/src/lib-storage/index/mbox/mbox-sync.c	Sun Jun 20 07:17:42 2004 +0300
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Sun Jun 20 07:18:12 2004 +0300
@@ -377,10 +377,9 @@
 
 		if (offset == mail->from_offset)
 			return 0;
-	} else {
-		offset = mail->from_offset;
 	}
 
+	offset = mail->from_offset;
 	mail_index_update_extra_rec(sync_ctx->t, sync_ctx->idx_seq,
 				    sync_ctx->ibox->mbox_extra_idx, &offset);
 	return 0;