mdbox-sync.c (dovecot-2.3.16) | : | mdbox-sync.c (dovecot-2.3.17) | ||
---|---|---|---|---|
skipping to change at line 321 | skipping to change at line 321 | |||
} | } | |||
mail_index_sync_set_reason(ctx->index_sync_ctx, reason); | mail_index_sync_set_reason(ctx->index_sync_ctx, reason); | |||
*ctx_r = ctx; | *ctx_r = ctx; | |||
return 0; | return 0; | |||
} | } | |||
int mdbox_sync_finish(struct mdbox_sync_context **_ctx, bool success) | int mdbox_sync_finish(struct mdbox_sync_context **_ctx, bool success) | |||
{ | { | |||
struct mdbox_sync_context *ctx = *_ctx; | struct mdbox_sync_context *ctx = *_ctx; | |||
struct mail_storage *storage = &ctx->mbox->storage->storage.storage; | ||||
int ret = success ? 0 : -1; | int ret = success ? 0 : -1; | |||
*_ctx = NULL; | *_ctx = NULL; | |||
if (success) { | if (success) { | |||
if (mail_index_sync_commit(&ctx->index_sync_ctx) < 0) { | if (mail_index_sync_commit(&ctx->index_sync_ctx) < 0) { | |||
mailbox_set_index_error(&ctx->mbox->box); | mailbox_set_index_error(&ctx->mbox->box); | |||
ret = -1; | ret = -1; | |||
} | } | |||
} else { | } else { | |||
mail_index_sync_rollback(&ctx->index_sync_ctx); | mail_index_sync_rollback(&ctx->index_sync_ctx); | |||
} | } | |||
if (storage->rebuild_list_index) | ||||
ret = mail_storage_list_index_rebuild_and_set_uncorrupted(storage | ||||
); | ||||
i_free(ctx); | i_free(ctx); | |||
return ret; | return ret; | |||
} | } | |||
int mdbox_sync(struct mdbox_mailbox *mbox, enum mdbox_sync_flags flags) | int mdbox_sync(struct mdbox_mailbox *mbox, enum mdbox_sync_flags flags) | |||
{ | { | |||
struct mdbox_sync_context *sync_ctx; | struct mdbox_sync_context *sync_ctx; | |||
struct mdbox_map_atomic_context *atomic; | struct mdbox_map_atomic_context *atomic; | |||
int ret; | int ret; | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 5 lines changed or added |