From: Timo Sirainen Date: Tue, 29 Jun 2010 18:04:39 +0000 (+0100) Subject: single-dbox: Fixed moving mails to alt storage. X-Git-Tag: 2.0.rc1~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5caa362b47a47226ad7fe4e8fa32b37afe7cd39f;p=thirdparty%2Fdovecot%2Fcore.git single-dbox: Fixed moving mails to alt storage. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/dbox-common/dbox-file.c b/src/lib-storage/index/dbox-common/dbox-file.c index fcdeed50ae..dacaf5c507 100644 --- a/src/lib-storage/index/dbox-common/dbox-file.c +++ b/src/lib-storage/index/dbox-common/dbox-file.c @@ -688,7 +688,6 @@ int dbox_file_move(struct dbox_file *file, bool alt_path) 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 --git a/src/lib-storage/index/dbox-single/sdbox-sync-file.c b/src/lib-storage/index/dbox-single/sdbox-sync-file.c index 22d1e225e8..d5fcd18fbb 100644 --- a/src/lib-storage/index/dbox-single/sdbox-sync-file.c +++ b/src/lib-storage/index/dbox-single/sdbox-sync-file.c @@ -17,14 +17,13 @@ dbox_sync_file_move_if_needed(struct dbox_file *file, 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); - } } }