comparison src/lib-storage/index/cydir/cydir-sync.c @ 6332:aa4a78b3c626 HEAD

Renamed mail_index_sync_begin() to mail_index_sync_begin_to() and added a new mail_index_sync_begin() without seq/offset parameters.
author Timo Sirainen <tss@iki.fi>
date Wed, 29 Aug 2007 22:58:27 +0300
parents ce83635191d4
children 65c69a53a7be
comparison
equal deleted inserted replaced
6331:081fd0acddd2 6332:aa4a78b3c626
112 int cydir_sync_begin(struct cydir_mailbox *mbox, 112 int cydir_sync_begin(struct cydir_mailbox *mbox,
113 struct cydir_sync_context **ctx_r) 113 struct cydir_sync_context **ctx_r)
114 { 114 {
115 struct cydir_sync_context *ctx; 115 struct cydir_sync_context *ctx;
116 enum mail_index_sync_flags sync_flags; 116 enum mail_index_sync_flags sync_flags;
117 int ret;
118 117
119 ctx = i_new(struct cydir_sync_context, 1); 118 ctx = i_new(struct cydir_sync_context, 1);
120 ctx->mbox = mbox; 119 ctx->mbox = mbox;
121 120
122 sync_flags = MAIL_INDEX_SYNC_FLAG_FLUSH_DIRTY; 121 sync_flags = MAIL_INDEX_SYNC_FLAG_FLUSH_DIRTY;
123 if (!mbox->ibox.keep_recent) 122 if (!mbox->ibox.keep_recent)
124 sync_flags |= MAIL_INDEX_SYNC_FLAG_DROP_RECENT; 123 sync_flags |= MAIL_INDEX_SYNC_FLAG_DROP_RECENT;
125 124
126 ret = mail_index_sync_begin(mbox->ibox.index, &ctx->index_sync_ctx, 125 if (mail_index_sync_begin(mbox->ibox.index, &ctx->index_sync_ctx,
127 &ctx->sync_view, &ctx->trans, 126 &ctx->sync_view, &ctx->trans,
128 (uint32_t)-1, (uoff_t)-1, sync_flags); 127 sync_flags) < 0) {
129 if (ret <= 0) { 128 mail_storage_set_index_error(&mbox->ibox);
130 if (ret < 0)
131 mail_storage_set_index_error(&mbox->ibox);
132 i_free(ctx); 129 i_free(ctx);
133 return ret; 130 return -1;
134 } 131 }
135 132
136 cydir_sync_index(ctx); 133 cydir_sync_index(ctx);
137 *ctx_r = ctx; 134 *ctx_r = ctx;
138 return 0; 135 return 0;