changeset 11656:a195689c4d38 HEAD

single-dbox: Fixed moving mails to alt storage.
author Timo Sirainen <tss@iki.fi>
date Tue, 29 Jun 2010 19:04:39 +0100
parents 077fb09819e2
children 4e5032891954
files src/lib-storage/index/dbox-common/dbox-file.c src/lib-storage/index/dbox-single/sdbox-sync-file.c
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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);
-		}
 	}
 }