~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-storage/index/dbox-single/sdbox-sync.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2007-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2007-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "dbox-attachment.h"
110
110
                mail_storage_set_critical(box->storage,
111
111
                        "sdbox %s: Broken index: missing UIDVALIDITY",
112
112
                        mailbox_get_path(box));
 
113
                sdbox_set_mailbox_corrupted(box);
113
114
                return 0;
114
115
        }
115
116
 
163
164
{
164
165
        struct mail_index_view *view;
165
166
        struct sdbox_index_header hdr;
 
167
        bool need_resize;
166
168
        int ret;
167
169
 
168
170
        view = mail_index_view_open(mbox->box.index);
169
 
        ret = sdbox_read_header(mbox, &hdr, log_error);
 
171
        ret = sdbox_read_header(mbox, &hdr, log_error, &need_resize);
170
172
        mail_index_view_close(&view);
171
173
 
172
174
        if (ret < 0 && retry) {
173
 
                (void)mail_index_refresh(mbox->box.index);
 
175
                mail_index_refresh(mbox->box.index);
174
176
                return sdbox_refresh_header(mbox, FALSE, log_error);
175
177
        }
176
178
        return ret;
213
215
                        sdbox_set_mailbox_corrupted(&mbox->box);
214
216
                if (ret <= 0) {
215
217
                        if (ret < 0)
216
 
                                mail_storage_set_index_error(&mbox->box);
 
218
                                mailbox_set_index_error(&mbox->box);
217
219
                        array_free(&ctx->expunged_uids);
218
220
                        i_free(ctx);
219
221
                        *ctx_r = NULL;
264
266
        if (success) {
265
267
                mail_index_view_ref(ctx->sync_view);
266
268
                if (mail_index_sync_commit(&ctx->index_sync_ctx) < 0) {
267
 
                        mail_storage_set_index_error(&ctx->mbox->box);
 
269
                        mailbox_set_index_error(&ctx->mbox->box);
268
270
                        ret = -1;
269
271
                } else {
270
272
                        dbox_sync_expunge_files(ctx);