]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: Purge crashed if it purged all messages from a file.
authorTimo Sirainen <tss@iki.fi>
Tue, 20 Apr 2010 15:05:08 +0000 (18:05 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 20 Apr 2010 15:05:08 +0000 (18:05 +0300)
--HG--
branch : HEAD

src/lib-storage/index/dbox-multi/mdbox-purge.c
src/lib-storage/index/dbox-multi/mdbox-storage.c

index e0649cd96874633743786db4b73b044f668ca1da..fd7d238a5e0b5ca59b2203ed03f0f51d89babdd7 100644 (file)
@@ -271,18 +271,22 @@ mdbox_file_purge(struct mdbox_purge_context *ctx, struct dbox_file *file)
 
        if (ret <= 0)
                ret = -1;
-       else {
+       else if (ctx->append_ctx == NULL) {
+               /* everything purged from this file */
+               ret = 1;
+       } else {
                /* assign new file_id + offset to moved messages */
                if (dbox_map_append_move(ctx->append_ctx, &copied_map_uids,
                                         &expunged_map_uids) < 0 ||
                    dbox_map_append_commit(ctx->append_ctx) < 0)
                        ret = -1;
-               else {
+               else
                        ret = 1;
-                       (void)dbox_file_unlink(file);
-               }
        }
-       dbox_map_append_free(&ctx->append_ctx);
+       if (ret > 0)
+               (void)dbox_file_unlink(file);
+       if (ctx->append_ctx != NULL)
+               dbox_map_append_free(&ctx->append_ctx);
        if (ret < 0)
                dbox_file_unlock(file);
        array_free(&copied_map_uids);
index 6773b00aa1f79682daadaec8b537f0e171defec9..8c95ae29a7342654e62502e9c1cccc5bd8dc9b88 100644 (file)
@@ -47,14 +47,6 @@ mdbox_storage_create(struct mail_storage *_storage, struct mail_namespace *ns,
                return -1;
        }
 
-#ifndef HAVE_FLOCK
-       if (master_service_get_client_limit(master_service) > 1) {
-               *error_r = "mdbox requires client_limit=1 for service "
-                       "since your OS doesn't support flock()";
-               return -1;
-       }
-#endif
-
        _storage->unique_root_dir =
                p_strdup(_storage->pool, ns->list->set.root_dir);