Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6273:df5c0e75c815 HEAD
Reverted last change and now the real compile fix..
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 12 Aug 2007 16:33:38 +0300 |
parents | cff0c129b3da |
children | bd67afb92ee5 |
files | src/plugins/fts/fts-storage.c |
diffstat | 1 files changed, 21 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/fts/fts-storage.c Sun Aug 12 16:32:18 2007 +0300 +++ b/src/plugins/fts/fts-storage.c Sun Aug 12 16:33:38 2007 +0300 @@ -84,9 +84,9 @@ return ret; } -static void uid_range_to_seq(struct mailbox *box, - ARRAY_TYPE(seq_range) *uid_range, - ARRAY_TYPE(seq_range) *seq_range) +static int uid_range_to_seq(struct mailbox *box, + ARRAY_TYPE(seq_range) *uid_range, + ARRAY_TYPE(seq_range) *seq_range) { const struct seq_range *range; struct seq_range new_range; @@ -95,11 +95,16 @@ range = array_get(uid_range, &count); i_array_init(seq_range, count); for (i = 0; i < count; i++) { - mailbox_get_uids(box, range[i].seq1, range[i].seq2, - &new_range.seq1, &new_range.seq2); + if (mailbox_get_uids(box, range[i].seq1, range[i].seq2, + &new_range.seq1, &new_range.seq2) < 0) { + array_free(seq_range); + return -1; + } + if (new_range.seq1 != 0) array_append(seq_range, &new_range, 1); } + return 0; } static int fts_build_mail_flush(struct fts_storage_build_context *ctx) @@ -241,8 +246,9 @@ } memset(&seqset, 0, sizeof(seqset)); - mailbox_get_uids(t->box, last_uid+1, (uint32_t)-1, - &seqset.seq1, &seqset.seq2); + if (mailbox_get_uids(t->box, last_uid+1, (uint32_t)-1, + &seqset.seq1, &seqset.seq2) < 0) + return -1; if (seqset.seq1 == 0) { /* no new messages */ return 0; @@ -254,8 +260,11 @@ i_assert(last_uid < last_uid_locked); last_uid = last_uid_locked; - mailbox_get_uids(t->box, last_uid+1, (uint32_t)-1, - &seqset.seq1, &seqset.seq2); + if (mailbox_get_uids(t->box, last_uid+1, (uint32_t)-1, + &seqset.seq1, &seqset.seq2) < 0) { + (void)fts_backend_build_deinit(build); + return -1; + } if (seqset.seq1 == 0) { /* no new messages */ (void)fts_backend_build_deinit(build); @@ -458,7 +467,7 @@ fts_search_filter_args(fctx, fctx->args, &uid_result); - uid_range_to_seq(box, &uid_result, &fctx->result); + (void)uid_range_to_seq(box, &uid_result, &fctx->result); array_free(&uid_result); } @@ -798,6 +807,7 @@ static int fts_transaction_commit(struct mailbox_transaction_context *t, enum mailbox_sync_flags flags, + uint32_t *uid_validity_r, uint32_t *first_saved_uid_r, uint32_t *last_saved_uid_r) { @@ -807,6 +817,7 @@ int ret; ret = fbox->module_ctx.super.transaction_commit(t, flags, + uid_validity_r, first_saved_uid_r, last_saved_uid_r); fts_transaction_finish(box, ft, ret == 0);