dovecot-2.0: single-dbox: Fixed moving mails to alt storage.

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 29 21:04:42 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/a195689c4d38
changeset: 11656:a195689c4d38
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 29 19:04:39 2010 +0100
description:
single-dbox: Fixed moving mails to alt storage.

diffstat:

 src/lib-storage/index/dbox-common/dbox-file.c       |  1 -
 src/lib-storage/index/dbox-single/sdbox-sync-file.c |  7 +++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r 077fb09819e2 -r a195689c4d38 src/lib-storage/index/dbox-common/dbox-file.c
--- a/src/lib-storage/index/dbox-common/dbox-file.c	Tue Jun 29 19:04:20 2010 +0100
+++ b/src/lib-storage/index/dbox-common/dbox-file.c	Tue Jun 29 19:04:39 2010 +0100
@@ -688,7 +688,6 @@
 	int out_fd, ret = 0;
 
 	i_assert(file->input != NULL);
-	i_assert(file->lock != NULL);
 
 	if (dbox_file_is_in_alt(file) == alt_path)
 		return 0;
diff -r 077fb09819e2 -r a195689c4d38 src/lib-storage/index/dbox-single/sdbox-sync-file.c
--- a/src/lib-storage/index/dbox-single/sdbox-sync-file.c	Tue Jun 29 19:04:20 2010 +0100
+++ b/src/lib-storage/index/dbox-single/sdbox-sync-file.c	Tue Jun 29 19:04:39 2010 +0100
@@ -17,14 +17,13 @@
 			      enum sdbox_sync_entry_type type)
 {
 	bool move_to_alt = type == SDBOX_SYNC_ENTRY_TYPE_MOVE_TO_ALT;
-	
+	bool deleted;
+
 	if (move_to_alt != dbox_file_is_in_alt(file)) {
 		/* move the file. if it fails, nothing broke so
 		   don't worry about it. */
-		if (dbox_file_try_lock(file) > 0) {
+		if (dbox_file_open(file, &deleted) > 0 && !deleted)
 			(void)dbox_file_move(file, move_to_alt);
-			dbox_file_unlock(file);
-		}
 	}
 }
 


More information about the dovecot-cvs mailing list