]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
single-dbox: Fixed moving mails to alt storage.
authorTimo Sirainen <tss@iki.fi>
Tue, 29 Jun 2010 18:04:39 +0000 (19:04 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 29 Jun 2010 18:04:39 +0000 (19:04 +0100)
--HG--
branch : HEAD

src/lib-storage/index/dbox-common/dbox-file.c
src/lib-storage/index/dbox-single/sdbox-sync-file.c

index fcdeed50ae72523ec3ac974ecdab20e603ab19d7..dacaf5c5079bf10ccd0626eea430745f6be68f3b 100644 (file)
@@ -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;
index 22d1e225e81307e44a4cc15cb4eb8df68264f1d6..d5fcd18fbbfd38ef6449dcfca830671babecd18f 100644 (file)
@@ -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);
-               }
        }
 }