From b3162129e6867c906da22f2517373bb97bebae58 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 17 May 2004 02:11:17 +0300 Subject: [PATCH] return value fixes --HG-- branch : HEAD --- src/imap/cmd-sort.c | 2 +- src/imap/cmd-thread.c | 2 +- src/imap/imap-sort.c | 6 +++--- src/imap/imap-thread.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/imap/cmd-sort.c b/src/imap/cmd-sort.c index 19ac7ba163..f7b71486dc 100644 --- a/src/imap/cmd-sort.c +++ b/src/imap/cmd-sort.c @@ -120,7 +120,7 @@ int cmd_sort(struct client *client) if (sargs == NULL) { /* error in search arguments */ client_send_tagline(client, t_strconcat("NO ", error, NULL)); - } else if (imap_sort(client, charset, sargs, sorting)) { + } else if (imap_sort(client, charset, sargs, sorting) == 0) { /* NOTE: syncing is allowed when returning UIDs */ if (client->cmd_uid) client_sync_full_fast(client); diff --git a/src/imap/cmd-thread.c b/src/imap/cmd-thread.c index be37faa845..834729fc3e 100644 --- a/src/imap/cmd-thread.c +++ b/src/imap/cmd-thread.c @@ -62,7 +62,7 @@ int cmd_thread(struct client *client) if (sargs == NULL) { /* error in search arguments */ client_send_tagline(client, t_strconcat("NO ", error, NULL)); - } else if (imap_thread(client, charset, sargs, threading)) { + } else if (imap_thread(client, charset, sargs, threading) == 0) { /* NOTE: syncing is allowed when returning UIDs */ if (client->cmd_uid) client_sync_full_fast(client); diff --git a/src/imap/imap-sort.c b/src/imap/imap-sort.c index d8a080d921..7d9f95fe9a 100644 --- a/src/imap/imap-sort.c +++ b/src/imap/imap-sort.c @@ -211,7 +211,7 @@ int imap_sort(struct client *client, const char *charset, /* remove the common part from sort program, we already know input is sorted that much so we don't have to worry about it. */ if (mailbox_search_get_sorting(client->mailbox, norm_prog) < 0) - return FALSE; + return -1; ctx->common_mask = mail_sort_get_common_mask(ctx->sort_program, norm_prog, &count); if (count > 0) { @@ -230,7 +230,7 @@ int imap_sort(struct client *client, const char *charset, wanted_fields, wanted_headers); if (ctx->search_ctx == NULL) { mailbox_transaction_rollback(ctx->t); - return FALSE; + return -1; } ctx->box = client->mailbox; @@ -252,7 +252,7 @@ int imap_sort(struct client *client, const char *charset, mailbox_transaction_rollback(ctx->t); - if (ctx->written || ret) { + if (ctx->written || ret == 0) { str_append(ctx->str, "\r\n"); o_stream_send(client->output, str_data(ctx->str), str_len(ctx->str)); diff --git a/src/imap/imap-thread.c b/src/imap/imap-thread.c index f8a6beec8c..97a7715fbc 100644 --- a/src/imap/imap-thread.c +++ b/src/imap/imap-thread.c @@ -123,7 +123,7 @@ int imap_thread(struct client *client, const char *charset, MAIL_FETCH_DATE, wanted_headers); if (ctx->search_ctx == NULL) { mailbox_transaction_rollback(ctx->t); - return FALSE; + return -1; } ctx->box = client->mailbox; @@ -149,7 +149,7 @@ int imap_thread(struct client *client, const char *charset, ret = mailbox_search_deinit(ctx->search_ctx); mailbox_transaction_rollback(ctx->t); mail_thread_deinit(ctx); - return ret == 0; + return ret; } static void add_root(struct thread_context *ctx, struct node *node) -- 2.47.3