[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.84, 1.85

cras at dovecot.org cras at dovecot.org
Sat Sep 11 23:20:27 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv4803

Modified Files:
	mbox-sync.c 
Log Message:
cleanups



Index: mbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- mbox-sync.c	11 Sep 2004 18:30:50 -0000	1.84
+++ mbox-sync.c	11 Sep 2004 20:20:25 -0000	1.85
@@ -467,7 +467,7 @@
 	return 0;
 }
 
-static int update_from_offsets(struct mbox_sync_context *sync_ctx)
+static void update_from_offsets(struct mbox_sync_context *sync_ctx)
 {
 	const struct mbox_sync_mail *mails;
 	uint32_t idx, extra_idx;
@@ -488,10 +488,9 @@
 		mail_index_update_extra_rec(sync_ctx->t, mails[idx].idx_seq,
 					    extra_idx, &offset);
 	}
-	return 0;
 }
 
-static int mbox_sync_handle_expunge(struct mbox_sync_mail_context *mail_ctx)
+static void mbox_sync_handle_expunge(struct mbox_sync_mail_context *mail_ctx)
 {
 	mail_ctx->mail.offset = mail_ctx->mail.from_offset;
 	mail_ctx->mail.space =
@@ -506,7 +505,6 @@
 	}
 
 	mail_ctx->sync_ctx->expunged_space += mail_ctx->mail.space;
-	return 0;
 }
 
 static int mbox_sync_handle_header(struct mbox_sync_mail_context *mail_ctx)
@@ -602,8 +600,7 @@
 			      sync_ctx->need_space_seq, sync_ctx->seq) < 0)
 		return -1;
 
-	if (update_from_offsets(sync_ctx) < 0)
-		return -1;
+	update_from_offsets(sync_ctx);
 
 	/* mail_ctx may contain wrong data after rewrite, so make sure we
 	   don't try to access it */
@@ -774,14 +771,13 @@
 		mail_ctx->mail.idx_seq = sync_ctx->idx_seq;
 
 		if (!expunged) {
-			ret = mbox_sync_handle_header(mail_ctx);
+			if (mbox_sync_handle_header(mail_ctx) < 0)
+				return -1;
 			sync_ctx->dest_first_mail = FALSE;
 		} else {
 			mail_ctx->mail.uid = 0;
-			ret = mbox_sync_handle_expunge(mail_ctx);
+			mbox_sync_handle_expunge(mail_ctx);
 		}
-		if (ret < 0)
-			return -1;
 
 		if (!mail_ctx->pseudo) {
 			if (!expunged) {
@@ -897,8 +893,7 @@
 				return -1;
 		}
 
-		if (update_from_offsets(sync_ctx) < 0)
-			return -1;
+		update_from_offsets(sync_ctx);
 
 		sync_ctx->need_space_seq = 0;
 		buffer_set_used_size(sync_ctx->mails, 0);



More information about the dovecot-cvs mailing list