]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
return value fixes
authorTimo Sirainen <tss@iki.fi>
Sun, 16 May 2004 23:11:17 +0000 (02:11 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 16 May 2004 23:11:17 +0000 (02:11 +0300)
--HG--
branch : HEAD

src/imap/cmd-sort.c
src/imap/cmd-thread.c
src/imap/imap-sort.c
src/imap/imap-thread.c

index 19ac7ba163ee0cbaa4339c6140ece09dffceba6d..f7b71486dc88c261fd7fae5c9d290b44b5318024 100644 (file)
@@ -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);
index be37faa845973ac239df12098f083a386a27dc09..834729fc3e460c40691c8881fc1bcab0077223bb 100644 (file)
@@ -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);
index d8a080d9216ee924f4844bcdee5ba8e1847773c6..7d9f95fe9a20620be415901aa02f79bae41e1fc3 100644 (file)
@@ -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));
index f8a6beec8c1d171e2f54e7a82d76f02d86586644..97a7715fbc40f2779bcd7b58a369da4c0b067e83 100644 (file)
@@ -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)