[dovecot-cvs] dovecot/src/lib-storage/index index-fetch.c,1.43,1.44

cras at procontrol.fi cras at procontrol.fi
Mon Jan 27 07:44:05 EET 2003


Update of /home/cvs/dovecot/src/lib-storage/index
In directory danu:/tmp/cvs-serv1462/src/lib-storage/index

Modified Files:
	index-fetch.c 
Log Message:
Allow update_seen to be NULL



Index: index-fetch.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-fetch.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- index-fetch.c	23 Jan 2003 21:17:52 -0000	1.43
+++ index-fetch.c	27 Jan 2003 05:44:03 -0000	1.44
@@ -30,11 +30,11 @@
 
 	ctx = i_new(struct mail_fetch_context, 1);
 
-	if (!box->readonly)
+	if (!box->readonly && update_seen != NULL)
 		*update_seen = FALSE;
 
 	/* need exclusive lock to update the \Seen flags */
-	if (*update_seen) {
+	if (update_seen != NULL && *update_seen) {
 		if (!index_storage_lock(ibox, MAIL_LOCK_EXCLUSIVE))
 			return NULL;
 	}
@@ -42,7 +42,7 @@
 	if (!index_storage_sync_and_lock(ibox, TRUE, MAIL_LOCK_SHARED))
 		return NULL;
 
-	if (*update_seen &&
+	if (update_seen != NULL && *update_seen &&
 	    ibox->index->header->messages_count ==
 	    ibox->index->header->seen_messages_count) {
 		/* if all messages are already seen, there's no point in
@@ -53,7 +53,7 @@
 
 	ctx->ibox = ibox;
 	ctx->index = ibox->index;
-	ctx->update_seen = *update_seen;
+	ctx->update_seen = update_seen != NULL && *update_seen;
 
 	index_mail_init(ibox, &ctx->mail, wanted_fields, NULL);
 	ctx->msgset_ctx = index_messageset_init(ibox, messageset, uidset, TRUE);




More information about the dovecot-cvs mailing list