]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Avoid using (void)s by adding ATTR_NOWARN_UNUSED_RESULT attributes and other ways.
authorTimo Sirainen <tss@iki.fi>
Mon, 25 Jun 2012 00:21:25 +0000 (03:21 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 25 Jun 2012 00:21:25 +0000 (03:21 +0300)
77 files changed:
src/auth/auth-worker-server.h
src/auth/passdb-blocking.c
src/auth/userdb-blocking.c
src/doveadm/doveadm-mail-expunge.c
src/doveadm/doveadm-mail.c
src/doveadm/dsync/dsync-brain-mailbox-tree.c
src/doveadm/dsync/dsync-brain-mailbox.c
src/doveadm/dsync/dsync-brain-mails.c
src/doveadm/dsync/dsync-slave-pipe.c
src/doveadm/dsync/dsync-slave.c
src/doveadm/dsync/dsync-slave.h
src/doveadm/dsync/dsync-transaction-log-scan.c
src/imap-login/client.c
src/imap/cmd-append.c
src/imap/imap-client.c
src/imap/imap-common.h
src/imap/imap-search.c
src/imap/imap-sync.c
src/imap/imap-sync.h
src/lib-dict/dict-client.c
src/lib-dict/dict-file.c
src/lib-imap-client/imapc-connection.c
src/lib-imap/imap-bodystructure.c
src/lib-index/mail-index-strmap.c
src/lib-index/mail-index-transaction.c
src/lib-index/mail-index.h
src/lib-index/mail-transaction-log-file.c
src/lib-mail/istream-binary-converter.c
src/lib-mail/message-decoder.c
src/lib-mail/message-parser.c
src/lib-mail/rfc2231-parser.h
src/lib-storage/index/dbox-multi/mdbox-mail.c
src/lib-storage/index/dbox-single/sdbox-mail.c
src/lib-storage/index/dbox-single/sdbox-sync.c
src/lib-storage/index/index-storage.c
src/lib-storage/index/index-thread.c
src/lib-storage/index/index-transaction.c
src/lib-storage/index/maildir/maildir-mail.c
src/lib-storage/index/maildir/maildir-sync.c
src/lib-storage/index/maildir/maildir-uidlist.c
src/lib-storage/index/mbox/mbox-lock.c
src/lib-storage/index/mbox/mbox-lock.h
src/lib-storage/index/mbox/mbox-mail.c
src/lib-storage/index/mbox/mbox-save.c
src/lib-storage/index/mbox/mbox-storage.c
src/lib-storage/index/mbox/mbox-sync.c
src/lib-storage/index/pop3c/pop3c-client.c
src/lib-storage/list/subscription-file.c
src/lib-storage/mail-storage.c
src/lib-storage/mail-storage.h
src/lib-storage/mailbox-list.h
src/lib-test/test-common.c
src/lib/bsearch-insert-pos.h
src/lib/file-dotlock.c
src/lib/file-dotlock.h
src/lib/iostream-rawlog.h
src/lib/istream-base64-encoder.c
src/lib/istream-data.c
src/lib/istream-private.h
src/lib/istream.c
src/lib/network.h
src/login-common/client-common-auth.c
src/login-common/client-common.h
src/login-common/login-proxy.c
src/login-common/ssl-proxy-gnutls.c
src/login-common/ssl-proxy-openssl.c
src/plugins/fts-lucene/fts-backend-lucene.c
src/plugins/fts-solr/fts-backend-solr-old.c
src/plugins/fts-solr/fts-backend-solr.c
src/plugins/fts/fts-api-private.h
src/plugins/fts/fts-api.c
src/plugins/fts/fts-parser-script.c
src/plugins/fts/fts-storage.c
src/plugins/imap-acl/imap-acl-plugin.c
src/plugins/imap-quota/imap-quota-plugin.c
src/plugins/imap-zlib/imap-zlib-plugin.c
src/pop3/pop3-client.c

index ed492b329e80f72c8b9c47252981c6393f287ce1..1c1f7b4f274dd625825c274e6c1e0d2a72a86d89 100644 (file)
@@ -6,7 +6,7 @@ struct auth_stream_reply;
 
 typedef bool auth_worker_callback_t(const char *reply, void *context);
 
-struct auth_worker_connection *
+struct auth_worker_connection * ATTR_NOWARN_UNUSED_RESULT
 auth_worker_call(pool_t pool, struct auth_stream_reply *data,
                 auth_worker_callback_t *callback, void *context);
 void auth_worker_server_resume_input(struct auth_worker_connection *conn);
index 6de2d51a150252c17e1eaeb126c1e325175b1011..6cb9980b541bbad5076a7df84a8285d970ae8b22 100644 (file)
@@ -88,8 +88,7 @@ void passdb_blocking_verify_plain(struct auth_request *request)
        auth_request_export(request, reply);
 
        auth_request_ref(request);
-       (void)auth_worker_call(request->pool, reply,
-                              verify_plain_callback, request);
+       auth_worker_call(request->pool, reply, verify_plain_callback, request);
 }
 
 static bool lookup_credentials_callback(const char *reply, void *context)
@@ -131,8 +130,8 @@ void passdb_blocking_lookup_credentials(struct auth_request *request)
        auth_request_export(request, reply);
 
        auth_request_ref(request);
-       (void)auth_worker_call(request->pool, reply,
-                              lookup_credentials_callback, request);
+       auth_worker_call(request->pool, reply,
+                        lookup_credentials_callback, request);
 }
 
 static bool
@@ -159,6 +158,6 @@ void passdb_blocking_set_credentials(struct auth_request *request,
        auth_request_export(request, reply);
 
        auth_request_ref(request);
-       (void)auth_worker_call(request->pool, reply,
-                              set_credentials_callback, request);
+       auth_worker_call(request->pool, reply,
+                        set_credentials_callback, request);
 }
index 88910d7d1ee90140cabf45da2335f836c847c6a7..a89a99899a6f09f9d218fbeecfa9bc03a0bd9564 100644 (file)
@@ -58,7 +58,7 @@ void userdb_blocking_lookup(struct auth_request *request)
        auth_request_export(request, reply);
 
        auth_request_ref(request);
-       (void)auth_worker_call(request->pool, reply, user_callback, request);
+       auth_worker_call(request->pool, reply, user_callback, request);
 }
 
 static bool iter_callback(const char *reply, void *context)
index 4913b50266cb600f301e1f53ad0fd56aa0b04466..8751eeda4051e8b782515c2beb94ac23a9f2240a 100644 (file)
@@ -48,7 +48,7 @@ cmd_expunge_box(struct doveadm_mail_cmd_context *_ctx,
 
        if (ctx->delete_empty_mailbox && ret == 0) {
                if (mailbox_delete_empty(box) < 0) {
-                       (void)mailbox_get_last_error(box, &error);
+                       error = mailbox_get_last_mail_error(box);
                        if (error != MAIL_ERROR_EXISTS) {
                                doveadm_mail_failed_mailbox(_ctx, box);
                                ret = -1;
index e1f7157807378006b4ff559eb1bd259faa0b7ff4..ecedcdc278ddb76b99bea8432d5e9d82923b2223 100644 (file)
@@ -76,7 +76,7 @@ void doveadm_mail_failed_storage(struct doveadm_mail_cmd_context *ctx,
 {
        enum mail_error error;
 
-       (void)mail_storage_get_last_error(storage, &error);
+       mail_storage_get_last_error(storage, &error);
        doveadm_mail_failed_error(ctx, error);
 }
 
index fa664e625fc5bb385023f250fbb66398a12309cb..b6422cee2bbf4058336dfb2eab1d9776f824624c 100644 (file)
@@ -122,8 +122,8 @@ void dsync_brain_send_mailbox_tree_deletes(struct dsync_brain *brain)
 
        deletes = dsync_mailbox_tree_get_deletes(brain->local_mailbox_tree,
                                                 &count);
-       (void)dsync_slave_send_mailbox_deletes(brain->slave, deletes, count,
-                                              brain->hierarchy_sep);
+       dsync_slave_send_mailbox_deletes(brain->slave, deletes, count,
+                                        brain->hierarchy_sep);
 
        brain->state = DSYNC_STATE_RECV_MAILBOX_TREE;
 }
index 4844e6e261d1f3ba346fbd7c61d3c58a929483e9..13316ab679754b4ac22aed71a9159ca3cc581ce0 100644 (file)
@@ -372,7 +372,7 @@ void dsync_brain_master_send_mailbox(struct dsync_brain *brain)
        }
 
        /* start exporting this mailbox (wait for remote to start importing) */
-       (void)dsync_slave_send_mailbox(brain->slave, &dsync_box);
+       dsync_slave_send_mailbox(brain->slave, &dsync_box);
        (void)dsync_brain_sync_mailbox_init(brain, box, &dsync_box,
                                            DSYNC_BOX_STATE_MAILBOX);
        brain->state = DSYNC_STATE_SYNC_MAILS;
@@ -560,13 +560,13 @@ bool dsync_brain_slave_recv_mailbox(struct dsync_brain *brain)
                memcpy(delete_box.mailbox_guid, dsync_box->mailbox_guid,
                       sizeof(delete_box.mailbox_guid));
                delete_box.mailbox_lost = TRUE;
-               (void)dsync_slave_send_mailbox(brain->slave, &delete_box);
+               dsync_slave_send_mailbox(brain->slave, &delete_box);
                return TRUE;
        }
        i_assert(local_dsync_box.uid_validity != 0);
        i_assert(memcmp(dsync_box->mailbox_guid, local_dsync_box.mailbox_guid,
                        sizeof(dsync_box->mailbox_guid)) == 0);
-       (void)dsync_slave_send_mailbox(brain->slave, &local_dsync_box);
+       dsync_slave_send_mailbox(brain->slave, &local_dsync_box);
 
        dsync_brain_mailbox_update_pre(brain, box, &local_dsync_box, dsync_box);
 
index e3ca4c975a30f1cb750dd6d8f4969ce72cb5fb57..33f95e53be27057fe67a8200666362cad473c880 100644 (file)
@@ -155,7 +155,7 @@ static void dsync_brain_sync_half_finished(struct dsync_brain *brain)
                if (changes_during_sync)
                        brain->changes_during_sync = TRUE;
        }
-       (void)dsync_slave_send_mailbox_state(brain->slave, &state);
+       dsync_slave_send_mailbox_state(brain->slave, &state);
 }
 
 static bool dsync_brain_recv_mail(struct dsync_brain *brain)
index 88192724c083c77ec031ad101381051d1b811a32..93c68354cb3fbc8480a72551ec4a00d4aad94b3d 100644 (file)
@@ -68,7 +68,7 @@ static pool_t dsync_slave_pipe_get_pool(struct dsync_slave_pipe *pipe)
        return ret;
 }
 
-static struct item *
+static struct item * ATTR_NOWARN_UNUSED_RESULT
 dsync_slave_pipe_push_item(struct dsync_slave_pipe *pipe, enum item_type type)
 {
        struct item *item;
@@ -193,7 +193,7 @@ dsync_slave_pipe_send_end_of_list(struct dsync_slave *slave)
 {
        struct dsync_slave_pipe *pipe = (struct dsync_slave_pipe *)slave;
 
-       (void)dsync_slave_pipe_push_item(pipe->remote, ITEM_END_OF_LIST);
+       dsync_slave_pipe_push_item(pipe->remote, ITEM_END_OF_LIST);
 }
 
 static void
index 30860ffe9609b5bdba95a9cda20bee355a807046..a63e16338bb436c1a6d89459303d231d00e76df9 100644 (file)
@@ -40,9 +40,11 @@ dsync_slave_send_ret(struct dsync_slave *slave)
                DSYNC_SLAVE_SEND_RET_OK;
 }
 
-void dsync_slave_send_end_of_list(struct dsync_slave *slave)
+enum dsync_slave_send_ret
+dsync_slave_send_end_of_list(struct dsync_slave *slave)
 {
        slave->v.send_end_of_list(slave);
+       return dsync_slave_send_ret(slave);
 }
 
 enum dsync_slave_send_ret
index b436450a82a1da72a456f4895c899ac197b88a0d..629e0702b75aed99ddc561d49014fb7d4e7b51e6 100644 (file)
@@ -54,16 +54,17 @@ enum dsync_slave_recv_ret
 dsync_slave_recv_handshake(struct dsync_slave *slave,
                           const struct dsync_slave_settings **set_r);
 
-void dsync_slave_send_end_of_list(struct dsync_slave *slave);
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
+dsync_slave_send_end_of_list(struct dsync_slave *slave);
 
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
 dsync_slave_send_mailbox_state(struct dsync_slave *slave,
                               const struct dsync_mailbox_state *state);
 enum dsync_slave_recv_ret
 dsync_slave_recv_mailbox_state(struct dsync_slave *slave,
                               struct dsync_mailbox_state *state_r);
 
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
 dsync_slave_send_mailbox_tree_node(struct dsync_slave *slave,
                                   const char *const *name,
                                   const struct dsync_mailbox_node *node);
@@ -72,7 +73,7 @@ dsync_slave_recv_mailbox_tree_node(struct dsync_slave *slave,
                                   const char *const **name_r,
                                   const struct dsync_mailbox_node **node_r);
 
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
 dsync_slave_send_mailbox_deletes(struct dsync_slave *slave,
                                 const struct dsync_mailbox_delete *deletes,
                                 unsigned int count, char hierarchy_sep);
@@ -81,28 +82,28 @@ dsync_slave_recv_mailbox_deletes(struct dsync_slave *slave,
                                 const struct dsync_mailbox_delete **deletes_r,
                                 unsigned int *count_r, char *hierarchy_sep_r);
 
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
 dsync_slave_send_mailbox(struct dsync_slave *slave,
                         const struct dsync_mailbox *dsync_box);
 enum dsync_slave_recv_ret
 dsync_slave_recv_mailbox(struct dsync_slave *slave,
                         const struct dsync_mailbox **dsync_box_r);
 
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
 dsync_slave_send_change(struct dsync_slave *slave,
                        const struct dsync_mail_change *change);
 enum dsync_slave_recv_ret
 dsync_slave_recv_change(struct dsync_slave *slave,
                        const struct dsync_mail_change **change_r);
 
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
 dsync_slave_send_mail_request(struct dsync_slave *slave,
                              const struct dsync_mail_request *request);
 enum dsync_slave_recv_ret
 dsync_slave_recv_mail_request(struct dsync_slave *slave,
                              const struct dsync_mail_request **request_r);
 
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
 dsync_slave_send_mail(struct dsync_slave *slave,
                      const struct dsync_mail *mail);
 enum dsync_slave_recv_ret
index 641559f0ce173f3f693a5039d33c000f90618abb..2b2fbe8cc6deb1379911e43af5993420027f9871 100644 (file)
@@ -19,7 +19,7 @@ struct dsync_transaction_log_scan {
        bool returned_all_changes;
 };
 
-static bool
+static bool ATTR_NOWARN_UNUSED_RESULT
 export_change_get(struct dsync_transaction_log_scan *ctx, uint32_t uid,
                  enum dsync_mail_change_type type,
                  struct dsync_mail_change **change_r)
@@ -74,9 +74,9 @@ log_add_expunge(struct dsync_transaction_log_scan *ctx, const void *data,
        end = CONST_PTR_OFFSET(data, hdr->size);
        for (; rec != end; rec++) {
                for (uid = rec->uid1; uid <= rec->uid2; uid++) {
-                       (void)export_change_get(ctx, uid,
-                                               DSYNC_MAIL_CHANGE_TYPE_EXPUNGE,
-                                               &change);
+                       export_change_get(ctx, uid,
+                                         DSYNC_MAIL_CHANGE_TYPE_EXPUNGE,
+                                         &change);
                }
        }
 }
@@ -95,9 +95,9 @@ log_add_expunge_uid(struct dsync_transaction_log_scan *ctx, const void *data,
        end = CONST_PTR_OFFSET(data, hdr->size);
        for (; rec != end; rec++) {
                if (uid >= rec->uid1 && uid <= rec->uid2) {
-                       (void)export_change_get(ctx, uid,
-                                               DSYNC_MAIL_CHANGE_TYPE_EXPUNGE,
-                                               &change);
+                       export_change_get(ctx, uid,
+                                         DSYNC_MAIL_CHANGE_TYPE_EXPUNGE,
+                                         &change);
                        return TRUE;
                }
        }
index d764cb89af8fd7b81511f361bc1154cbcf6c45e4..212bdc0951b5c949decb5d247cafc762ae2566ba 100644 (file)
@@ -371,7 +371,7 @@ static void imap_client_input(struct client *client)
                }
        }
        o_stream_uncork(imap_client->common.output);
-       (void)client_unref(&client);
+       client_unref(&client);
 }
 
 static struct client *imap_client_alloc(pool_t pool)
index 32af8d8270f2348feb0d132c60b2910881f00cd2..4a1deb9adecc1237cc989471be68eb1ad1c6f4db 100644 (file)
@@ -114,7 +114,7 @@ static void client_input_append(struct client_command_context *cmd)
                (void)client_handle_unfinished_cmd(cmd);
        else
                client_command_free(&cmd);
-       (void)cmd_sync_delayed(client);
+       cmd_sync_delayed(client);
        o_stream_uncork(client->output);
 
        if (client->disconnected)
index 40ba0ebcad232a01517d30ce466f7357549af8a6..eff53a6c46c54899f75eb6735a13622e0d0e5e4b 100644 (file)
@@ -807,7 +807,7 @@ bool client_handle_input(struct client *client)
                return FALSE;
 
        if (client->input_lock == NULL)
-               (void)cmd_sync_delayed(client);
+               cmd_sync_delayed(client);
        return TRUE;
 }
 
@@ -912,7 +912,7 @@ int client_output(struct client *client)
                }
        }
 
-       (void)cmd_sync_delayed(client);
+       cmd_sync_delayed(client);
        o_stream_uncork(client->output);
        if (client->disconnected)
                client_destroy(client, NULL);
index ec4aff3cbb511d996cb287ca5a02e2f181b9ce96..fbe0043896a3cd8079dd8ed0b7ae3a4e630229cb 100644 (file)
@@ -23,7 +23,7 @@ extern imap_client_created_func_t *hook_client_created;
 
 /* Sets the hook_client_created and returns the previous hook,
    which the new_hook should call if it's non-NULL. */
-imap_client_created_func_t *
+imap_client_created_func_t * ATTR_NOWARN_UNUSED_RESULT
 imap_client_created_hook_set(imap_client_created_func_t *new_hook);
 
 void imap_refresh_proctitle(void);
index 5bae74e8a0573243f3972c550aceff768b175462..b7123f69d51ca3f16ec6a210246abe0b9db57249 100644 (file)
@@ -490,7 +490,7 @@ static void cmd_search_more_callback(struct client_command_context *cmd)
                (void)client_handle_unfinished_cmd(cmd);
        else
                client_command_free(&cmd);
-       (void)cmd_sync_delayed(client);
+       cmd_sync_delayed(client);
 
        if (client->disconnected)
                client_destroy(client, NULL);
index 150ea372a914cd5b8f6b8f86ebc7492ec0a91559..2fa3ca5c87f16068d3b104475eae6e16c64038f6 100644 (file)
@@ -603,7 +603,7 @@ static bool cmd_sync_client(struct client_command_context *sync_cmd)
        }
 
        client_command_free(&sync_cmd);
-       (void)cmd_sync_delayed(client);
+       cmd_sync_delayed(client);
        return TRUE;
 }
 
index 37d0cc9a008f0898ebe225f7e01ce110ed43df92..e5b49d9a868abd3aea0d62657eff8ca0bd579022 100644 (file)
@@ -26,6 +26,6 @@ bool cmd_sync_callback(struct client_command_context *cmd,
                       enum mailbox_sync_flags flags,
                       enum imap_sync_flags imap_flags,
                       imap_sync_callback_t *callback);
-bool cmd_sync_delayed(struct client *client);
+bool cmd_sync_delayed(struct client *client) ATTR_NOWARN_UNUSED_RESULT;
 
 #endif
index 18394bfb8d2b19718d9ee78bc572617cc0267f4e..bcaee6b3e52b1bb6b95351067a175dda47a57589 100644 (file)
@@ -207,7 +207,7 @@ client_dict_transaction_send_begin(struct client_dict_transaction_context *ctx)
        return ctx->failed ? -1 : 0;
 }
 
-static int
+static int ATTR_NOWARN_UNUSED_RESULT
 client_dict_send_transaction_query(struct client_dict_transaction_context *ctx,
                                   const char *query)
 {
@@ -743,7 +743,7 @@ client_dict_transaction_rollback(struct dict_transaction_context *_ctx)
 
                query = t_strdup_printf("%c%u\n", DICT_PROTOCOL_CMD_ROLLBACK,
                                        ctx->id);
-               (void)client_dict_send_transaction_query(ctx, query);
+               client_dict_send_transaction_query(ctx, query);
        } T_END;
 
        DLLIST_REMOVE(&dict->transactions, ctx);
@@ -765,7 +765,7 @@ static void client_dict_set(struct dict_transaction_context *_ctx,
                                        DICT_PROTOCOL_CMD_SET, ctx->id,
                                        dict_client_escape(key),
                                        dict_client_escape(value));
-               (void)client_dict_send_transaction_query(ctx, query);
+               client_dict_send_transaction_query(ctx, query);
        } T_END;
 }
 
@@ -781,7 +781,7 @@ static void client_dict_unset(struct dict_transaction_context *_ctx,
                query = t_strdup_printf("%c%u\t%s\n",
                                        DICT_PROTOCOL_CMD_UNSET, ctx->id,
                                        dict_client_escape(key));
-               (void)client_dict_send_transaction_query(ctx, query);
+               client_dict_send_transaction_query(ctx, query);
        } T_END;
 }
 
@@ -796,7 +796,7 @@ static void client_dict_atomic_inc(struct dict_transaction_context *_ctx,
                query = t_strdup_printf("%c%u\t%s\t%lld\n",
                                        DICT_PROTOCOL_CMD_ATOMIC_INC,
                                        ctx->id, dict_client_escape(key), diff);
-               (void)client_dict_send_transaction_query(ctx, query);
+               client_dict_send_transaction_query(ctx, query);
        } T_END;
 }
 
index 3d96acc94f77c0e29a9792ada7a603fe19013aed..6a9782d5e7e5720b89d5e19a5d203bd7f3373686 100644 (file)
@@ -492,7 +492,7 @@ static int file_dict_write_changes(struct file_dict_transaction_context *ctx)
        /* refresh once more now that we're locked */
        if (file_dict_refresh(dict) < 0) {
                if (dotlock != NULL)
-                       (void)file_dotlock_delete(&dotlock);
+                       file_dotlock_delete(&dotlock);
                else {
                        i_close_fd(fd);
                        file_unlock(&lock);
index c64dcf8f985abef8cc84c8760be8c7f8f3961164..678276cc9de269b8b3c3d512d8b5255b93ec556f 100644 (file)
@@ -1202,8 +1202,8 @@ static int imapc_connection_ssl_init(struct imapc_connection *conn)
 
        if (*conn->client->set.rawlog_dir != '\0' &&
            stat(conn->client->set.rawlog_dir, &st) == 0) {
-               (void)iostream_rawlog_create(conn->client->set.rawlog_dir,
-                                            &conn->input, &conn->output);
+               iostream_rawlog_create(conn->client->set.rawlog_dir,
+                                      &conn->input, &conn->output);
        }
 
        imap_parser_set_streams(conn->parser, conn->input, NULL);
@@ -1299,8 +1299,8 @@ static void imapc_connection_connect_next_ip(struct imapc_connection *conn)
        if (*conn->client->set.rawlog_dir != '\0' &&
            conn->client->set.ssl_mode != IMAPC_CLIENT_SSL_MODE_IMMEDIATE &&
            stat(conn->client->set.rawlog_dir, &st) == 0) {
-               (void)iostream_rawlog_create(conn->client->set.rawlog_dir,
-                                            &conn->input, &conn->output);
+               iostream_rawlog_create(conn->client->set.rawlog_dir,
+                                      &conn->input, &conn->output);
        }
 
        o_stream_set_flush_callback(conn->output, imapc_connection_output,
index cd5a1b66c7ffcc09ee184e56cec4199be5b0a24b..5021016b4a36e3ab41716f636f5d134b8ed9ce12 100644 (file)
@@ -64,7 +64,7 @@ static void parse_content_type(struct message_part_body_data *data,
 
        /* parse parameters and save them */
        str_truncate(str, 0);
-       (void)rfc2231_parse(&parser, &results);
+       rfc2231_parse(&parser, &results);
        for (; *results != NULL; results += 2) {
                if (strcasecmp(results[0], "charset") == 0)
                        charset_found = TRUE;
@@ -122,7 +122,7 @@ static void parse_content_disposition(struct message_part_body_data *data,
 
        /* parse parameters and save them */
        str_truncate(str, 0);
-       (void)rfc2231_parse(&parser, &results);
+       rfc2231_parse(&parser, &results);
        for (; *results != NULL; results += 2) {
                str_append_c(str, ' ');
                imap_quote_append_string(str, results[0], TRUE);
index 5bccabcda355327016f7b8529ddabcfc1c463159..57599618baa3c9431eb3d3a9cbb4f5e0f98ecd4d 100644 (file)
@@ -403,7 +403,7 @@ mail_index_strmap_uid_exists(struct mail_index_strmap_read_context *ctx,
                   see if it's because the strmap is corrupted or because
                   our current view is a bit stale and the message has already
                   been expunged. */
-               (void)mail_index_refresh(ctx->view->view->index);
+               mail_index_refresh(ctx->view->view->index);
                if (mail_index_is_expunged(ctx->view->view,
                                           ctx->uid_lookup_idx + 1))
                        ctx->lost_expunged_uid = rec->uid;
index fff056f60dfadbe3f5bf3344a683228ce4cfc0bd..8e635f9d6dae36440dde16fee6c10347537c509c 100644 (file)
@@ -98,7 +98,7 @@ void mail_index_transaction_lookup_latest_keywords(struct mail_index_transaction
        uint32_t uid, latest_seq;
 
        if (t->latest_view == NULL) {
-               (void)mail_index_refresh(t->view->index);
+               mail_index_refresh(t->view->index);
                t->latest_view = mail_index_view_open(t->view->index);
        }
        mail_index_lookup_uid(t->view, seq, &uid);
@@ -210,7 +210,7 @@ static int mail_index_transaction_commit_v(struct mail_index_transaction *t,
                   expunge handlers get run for the newly expunged messages
                   (and sync handlers that require HANDLER_FILE as well). */
                index->sync_commit_result = result_r;
-               (void)mail_index_refresh(index);
+               mail_index_refresh(index);
                index->sync_commit_result = NULL;
        }
 
index d8a56bd65bbf64752385f2711cd0e4321da5f6f9..fbc731c29225853deea2396359598e2f75510af0 100644 (file)
@@ -246,7 +246,8 @@ struct mail_cache *mail_index_get_cache(struct mail_index *index);
 /* Refresh index so mail_index_lookup*() will return latest values. Note that
    immediately after this call there may already be changes, so if you need to
    rely on validity of the returned values, use some external locking for it. */
-int mail_index_refresh(struct mail_index *index);
+int ATTR_NOWARN_UNUSED_RESULT
+mail_index_refresh(struct mail_index *index);
 
 /* View can be used to look into index. Sequence numbers inside view change
    only when you synchronize it. The view acquires required locks
index f189182fc14dab2abb9dd38fdfaf6d45d3127272..fa5a801b9ec17133ea14fd097ac07a90d0232771 100644 (file)
@@ -317,7 +317,7 @@ mail_transaction_log_file_undotlock(struct mail_transaction_log_file *file)
        if (--file->log->dotlock_count > 0)
                return 0;
 
-       ret = file_dotlock_delete_verified(&file->log->dotlock);
+       ret = file_dotlock_delete(&file->log->dotlock);
        if (ret < 0) {
                log_file_set_syscall_error(file, "file_dotlock_delete()");
                return -1;
index ec99b83374b13010ab696456173c9f0eb428ed53..6ca9848b748a139035c17669de177f68d9f91f8f 100644 (file)
@@ -36,14 +36,14 @@ stream_alloc_data(struct binary_converter_istream *bstream, size_t size)
        struct istream_private *stream = &bstream->istream;
        size_t old_size, avail_size;
 
-       (void)i_stream_get_buffer_space(stream, size, &avail_size);
+       i_stream_get_buffer_space(stream, size, &avail_size);
        if (avail_size < size) {
                old_size = stream->buffer_size;
                stream->buffer_size = nearest_power(stream->pos + size);
                stream->w_buffer = i_realloc(stream->w_buffer, old_size,
                                             stream->buffer_size);
                stream->buffer = stream->w_buffer;
-               (void)i_stream_get_buffer_space(stream, size, &avail_size);
+               i_stream_get_buffer_space(stream, size, &avail_size);
                i_assert(avail_size >= size);
        }
        return stream->w_buffer + stream->pos;
index c62fdf2e67937160a2fade8b6753abf4acd68e80..047bff4ee91d93f5cc300e6b435d6186eee1d19b 100644 (file)
@@ -142,7 +142,7 @@ parse_content_type(struct message_decoder_context *ctx,
        if (rfc822_parse_content_type(&parser, str) <= 0)
                return;
 
-       (void)rfc2231_parse(&parser, &results);
+       rfc2231_parse(&parser, &results);
        for (; *results != NULL; results += 2) {
                if (strcasecmp(results[0], "charset") == 0) {
                        ctx->content_charset = i_strdup(results[1]);
index 6bc9d1e7c92f5693ee15e008cfcdac4b34714421..75cbbb3de20402ee9053686394ff4c4ee1761d31 100644 (file)
@@ -487,7 +487,7 @@ static void parse_content_type(struct message_parser_ctx *ctx,
            ctx->last_boundary != NULL)
                return;
 
-       (void)rfc2231_parse(&parser, &results);
+       rfc2231_parse(&parser, &results);
        for (; *results != NULL; results += 2) {
                if (strcasecmp(results[0], "boundary") == 0) {
                        ctx->last_boundary =
index 08f53e5941dfb3f35de848b5490c209261c2d074..1c44349880a018697e9ea3a02cada7223ec6bac9 100644 (file)
@@ -5,7 +5,8 @@
    them as a NULL-terminated [key, value] array. RFC 2231-style continuations
    are merged to a single key. Returns -1 if some of the input was invalid
    (but valid key/value pairs are still returned), 0 if everything looked ok. */
-int rfc2231_parse(struct rfc822_parser_context *ctx,
-                 const char *const **result_r);
+int ATTR_NOWARN_UNUSED_RESULT
+rfc2231_parse(struct rfc822_parser_context *ctx,
+             const char *const **result_r);
 
 #endif
index b4ec186bcd20153c37a926816fa44cdf131f4889..7a93ca8497b1eeba5d8e7b834b9af822109aa833 100644 (file)
@@ -60,7 +60,7 @@ static void dbox_mail_set_expunged(struct dbox_mail *mail, uint32_t map_uid)
        struct mail *_mail = &mail->imail.mail.mail;
        struct mdbox_mailbox *mbox = (struct mdbox_mailbox *)_mail->box;
 
-       (void)mail_index_refresh(_mail->box->index);
+       mail_index_refresh(_mail->box->index);
        if (mail_index_is_expunged(_mail->transaction->view, _mail->seq)) {
                mail_set_expunged(_mail);
                return;
index 2e0d5bbe1b96cce3e93d7029835ed8e26f1e1473..69f9a3038ad2b4debc0b61a64d7621f0070e1cd5 100644 (file)
@@ -16,7 +16,7 @@ static void sdbox_mail_set_expunged(struct dbox_mail *mail)
 {
        struct mail *_mail = &mail->imail.mail.mail;
 
-       (void)mail_index_refresh(_mail->box->index);
+       mail_index_refresh(_mail->box->index);
        if (mail_index_is_expunged(_mail->transaction->view, _mail->seq)) {
                mail_set_expunged(_mail);
                return;
index fda67c7b86974908e6a43787148f6ce03655203a..9b2f0b24cdb771f72f06f908b8764fa277f551fa 100644 (file)
@@ -170,7 +170,7 @@ sdbox_refresh_header(struct sdbox_mailbox *mbox, bool retry, bool log_error)
        mail_index_view_close(&view);
 
        if (ret < 0 && retry) {
-               (void)mail_index_refresh(mbox->box.index);
+               mail_index_refresh(mbox->box.index);
                return sdbox_refresh_header(mbox, FALSE, log_error);
        }
        return ret;
index b9e15cb251a770656d92ea7a5c3eaa72cd43af6c..ff398a2b3c0471087bdd07936f044791e3f2b13b 100644 (file)
@@ -418,7 +418,7 @@ int index_storage_mailbox_update(struct mailbox *box,
                index_storage_mailbox_update_cache(box, update);
 
        /* make sure we get the latest index info */
-       (void)mail_index_refresh(box->index);
+       mail_index_refresh(box->index);
        view = mail_index_view_open(box->index);
        hdr = mail_index_get_header(view);
 
@@ -473,7 +473,7 @@ int index_storage_mailbox_delete_dir(struct mailbox *box, bool mailbox_deleted)
        if (mailbox_list_delete_dir(box->list, box->name) == 0)
                return 0;
 
-       (void)mailbox_list_get_last_error(box->list, &error);
+       mailbox_list_get_last_error(box->list, &error);
        if (error != MAIL_ERROR_NOTFOUND || !mailbox_deleted) {
                mail_storage_copy_list_error(box->storage, box->list);
                return -1;
@@ -517,7 +517,6 @@ int index_storage_mailbox_delete(struct mailbox *box)
 {
        struct mailbox_metadata metadata;
        struct mailbox_status status;
-       enum mail_error error;
        int ret_guid;
 
        if (!box->opened) {
@@ -577,8 +576,7 @@ int index_storage_mailbox_delete(struct mailbox *box)
                                        metadata.guid);
        }
        if (index_storage_mailbox_delete_dir(box, TRUE) < 0) {
-               (void)mailbox_get_last_error(box, &error);
-               if (error != MAIL_ERROR_EXISTS)
+               if (mailbox_get_last_mail_error(box) != MAIL_ERROR_EXISTS)
                        return -1;
                /* we deleted the mailbox, but couldn't delete the directory
                   because it has children. that's not an error. */
index 205769dd4e54a2b6a2c637aef1026a5aea0f8a12..5392b0c1917afd1d6edada4f6cbf1ee600847268 100644 (file)
@@ -387,9 +387,9 @@ static bool mail_thread_cache_update_removes(struct mail_thread_mailbox *tbox,
        uids = array_get(&removed_uids, &uid_count);
        for (i = j = 0; i < uid_count; i++) {
                /* find and remove from the map */
-               (void)bsearch_insert_pos(&uids[i].seq1, &msgid_map[j],
-                                        map_count - j, sizeof(*msgid_map),
-                                        msgid_map_cmp, &idx);
+               bsearch_insert_pos(&uids[i].seq1, &msgid_map[j],
+                                  map_count - j, sizeof(*msgid_map),
+                                  msgid_map_cmp, &idx);
                j += idx;
                if (j == map_count) {
                        /* all removals after this are about messages we never
index 35c19bb8b1c9bc85b61577c16be3571fe6a39349..1fc80600eae17951fdd35e348a1ed2193466b690 100644 (file)
@@ -107,7 +107,7 @@ void index_transaction_init(struct mailbox_transaction_context *t,
 
        itrans_flags = index_transaction_flags_get(flags);
        if ((flags & MAILBOX_TRANSACTION_FLAG_REFRESH) != 0)
-               (void)mail_index_refresh(box->index);
+               mail_index_refresh(box->index);
 
        t->box = box;
        t->itrans = mail_index_transaction_begin(box->view, itrans_flags);
index 6e82c9b9c7b9f72d6c866c21b3a99f9d8df2a377..2810a66e8fbcfe1236b5d877e56d8797a01f5bfe 100644 (file)
@@ -201,7 +201,7 @@ maildir_mail_get_fname(struct maildir_mailbox *mbox, struct mail *mail,
        /* one reason this could happen is if we delayed opening
           dovecot-uidlist and we're trying to open a mail that got recently
           expunged. Let's test this theory first: */
-       (void)mail_index_refresh(mbox->box.index);
+       mail_index_refresh(mbox->box.index);
        view = mail_index_view_open(mbox->box.index);
        exists = mail_index_lookup_seq(view, mail->uid, &seq);
        mail_index_view_close(&view);
index b62a7303c78f6ab1cc2ca99f052ed232ca3c7944..9bcd089a960d23207bd14459a34ac74aaa982da6 100644 (file)
@@ -744,7 +744,7 @@ static int maildir_sync_get_changes(struct maildir_sync_context *ctx,
        if (mbox->synced) {
                /* refresh index only after the first sync, i.e. avoid wasting
                   time on refreshing it immediately after it was just opened */
-               (void)mail_index_refresh(mbox->box.index);
+               mail_index_refresh(mbox->box.index);
        }
        return mail_index_sync_have_any(mbox->box.index, flags) ? 1 : 0;
 }
@@ -999,7 +999,7 @@ int maildir_sync_refresh_flags_view(struct maildir_mailbox *mbox)
        struct mail_index_view_sync_ctx *sync_ctx;
        bool delayed_expunges;
 
-       (void)mail_index_refresh(mbox->box.index);
+       mail_index_refresh(mbox->box.index);
        if (mbox->flags_view == NULL)
                mbox->flags_view = mail_index_view_open(mbox->box.index);
 
index 780bb6ea2218fc49051034407290cc23db0eba44..b5555380db90c5334b7cf34031126a5bd5b87f19 100644 (file)
@@ -1335,7 +1335,7 @@ maildir_uidlist_records_drop_expunges(struct maildir_uidlist *uidlist)
        if (!uidlist->box->opened)
                return;
 
-       (void)mail_index_refresh(uidlist->box->index);
+       mail_index_refresh(uidlist->box->index);
        view = mail_index_view_open(uidlist->box->index);
        count = array_count(&uidlist->records);
        hdr = mail_index_get_header(view);
index 227755dd52ae0c3050e15abd50e030ad6462b6ba..67af3e227088048c6d41440fac7af0b086305e51 100644 (file)
@@ -86,9 +86,11 @@ static struct mbox_lock_data lock_data[] = {
        { 0, NULL, NULL }
 };
 
-static int mbox_lock_list(struct mbox_lock_context *ctx, int lock_type,
-                         time_t max_wait_time, int idx);
-static int mbox_unlock_files(struct mbox_lock_context *ctx);
+static int ATTR_NOWARN_UNUSED_RESULT
+mbox_lock_list(struct mbox_lock_context *ctx, int lock_type,
+              time_t max_wait_time, int idx);
+static int ATTR_NOWARN_UNUSED_RESULT
+mbox_unlock_files(struct mbox_lock_context *ctx);
 
 static void mbox_read_lock_methods(const char *str, const char *env,
                                   enum mbox_lock_type *locks)
@@ -228,7 +230,7 @@ static bool dotlock_callback(unsigned int secs_left, bool stale, void *context)
                                ctx->dotlock_last_stale = TRUE;
                                return FALSE;
                        }
-                       (void)mbox_lock_list(ctx, F_UNLCK, 0, i);
+                       mbox_lock_list(ctx, F_UNLCK, 0, i);
                }
        }
        ctx->dotlock_last_stale = stale;
@@ -246,7 +248,7 @@ static bool dotlock_callback(unsigned int secs_left, bool stale, void *context)
        return TRUE;
 }
 
-static int ATTR_NULL(2)
+static int ATTR_NULL(2) ATTR_NOWARN_UNUSED_RESULT
 mbox_dotlock_privileged_op(struct mbox_mailbox *mbox,
                           struct dotlock_settings *set,
                           enum mbox_dotlock_op op)
@@ -315,7 +317,7 @@ mbox_dotlock_privileged_op(struct mbox_mailbox *mbox,
                break;
        case MBOX_DOTLOCK_OP_UNLOCK:
                /* we're now privileged - avoid doing as much as possible */
-               ret = file_dotlock_delete_verified(&mbox->mbox_dotlock);
+               ret = file_dotlock_delete(&mbox->mbox_dotlock);
                if (ret < 0)
                        mbox_set_syscall_error(mbox, "file_dotlock_delete()");
                mbox->mbox_used_privileges = FALSE;
@@ -391,14 +393,14 @@ mbox_lock_dotlock_int(struct mbox_lock_context *ctx, int lock_type, bool try)
                        return 1;
 
                if (!mbox->mbox_used_privileges) {
-                       if (file_dotlock_delete_verified(&mbox->mbox_dotlock) <= 0) {
+                       if (file_dotlock_delete(&mbox->mbox_dotlock) <= 0) {
                                mbox_set_syscall_error(mbox,
                                                       "file_dotlock_delete()");
                        }
                } else {
                        ctx->using_privileges = TRUE;
-                       (void)mbox_dotlock_privileged_op(mbox, NULL,
-                                                        MBOX_DOTLOCK_OP_UNLOCK);
+                       mbox_dotlock_privileged_op(mbox, NULL,
+                                                  MBOX_DOTLOCK_OP_UNLOCK);
                        ctx->using_privileges = FALSE;
                }
                 mbox->mbox_dotlocked = FALSE;
@@ -666,8 +668,9 @@ static int mbox_lock_fcntl(struct mbox_lock_context *ctx, int lock_type,
        return 1;
 }
 
-static int mbox_lock_list(struct mbox_lock_context *ctx, int lock_type,
-                         time_t max_wait_time, int idx)
+static int ATTR_NOWARN_UNUSED_RESULT
+mbox_lock_list(struct mbox_lock_context *ctx, int lock_type,
+              time_t max_wait_time, int idx)
 {
        enum mbox_lock_type *lock_types;
         enum mbox_lock_type type;
@@ -742,7 +745,7 @@ static int mbox_update_locking(struct mbox_mailbox *mbox, int lock_type,
        ret = mbox_lock_list(&ctx, lock_type, max_wait_time, 0);
        if (ret <= 0) {
                if (!drop_locks)
-                       (void)mbox_unlock_files(&ctx);
+                       mbox_unlock_files(&ctx);
                if (ret == 0) {
                        mail_storage_set_error(&mbox->storage->storage,
                                MAIL_ERROR_TEMP, MAIL_ERRSTR_LOCK_TIMEOUT);
@@ -765,7 +768,7 @@ static int mbox_update_locking(struct mbox_mailbox *mbox, int lock_type,
                        ctx.lock_status[read_locks[i]] = 0;
 
                mbox->mbox_lock_type = F_WRLCK;
-               (void)mbox_lock_list(&ctx, F_UNLCK, 0, 0);
+               mbox_lock_list(&ctx, F_UNLCK, 0, 0);
                mbox->mbox_lock_type = F_RDLCK;
        }
 
@@ -883,7 +886,7 @@ void mbox_dotlock_touch(struct mbox_mailbox *mbox)
        if (!mbox->mbox_used_privileges)
                (void)file_dotlock_touch(mbox->mbox_dotlock);
        else {
-               (void)mbox_dotlock_privileged_op(mbox, NULL,
+               mbox_dotlock_privileged_op(mbox, NULL,
                                                 MBOX_DOTLOCK_OP_TOUCH);
        }
 }
index 68b917bc4e3bda8d95c3f27be8d07444d1c0bd84..0f8bd1871a0d8b036a76be4999a539e3ae42f0ca 100644 (file)
@@ -5,7 +5,8 @@
    been overwritten (ie. inode has changed), it's reopened. */
 int mbox_lock(struct mbox_mailbox *mbox, int lock_type,
              unsigned int *lock_id_r);
-int mbox_unlock(struct mbox_mailbox *mbox, unsigned int lock_id);
+int ATTR_NOWARN_UNUSED_RESULT
+mbox_unlock(struct mbox_mailbox *mbox, unsigned int lock_id);
 
 void mbox_dotlock_touch(struct mbox_mailbox *mbox);
 
index 89b1f5d6aac4637e32525bade424bcaa9eed240a..92d58c0489158d608f1d828eaeb69eaedb5ace73 100644 (file)
@@ -25,7 +25,7 @@ static void mbox_prepare_resync(struct mail *mail)
        if (mbox->mbox_lock_type == F_RDLCK) {
                if (mbox->mbox_lock_id == t->mbox_lock_id)
                        t->mbox_lock_id = 0;
-               (void)mbox_unlock(mbox, mbox->mbox_lock_id);
+               mbox_unlock(mbox, mbox->mbox_lock_id);
                i_assert(mbox->mbox_lock_type == F_UNLCK);
        }
 }
index 85539dd20cf1c9cdd509120532e323065d88f16e..26195b1ad2e0c21f2327216bac7e7cedb8a20c6a 100644 (file)
@@ -203,7 +203,7 @@ static void mbox_save_init_sync(struct mailbox_transaction_context *t)
 
        /* open a new view to get the header. this is required if we just
           synced the mailbox so we can get updated next_uid. */
-       (void)mail_index_refresh(mbox->box.index);
+       mail_index_refresh(mbox->box.index);
        view = mail_index_view_open(mbox->box.index);
        hdr = mail_index_get_header(view);
 
index 550b77bd0027ca1fc6cf4c068a276fe10dba2ed3..d9558249031e6a9466bbe9ff180b804e214ff9db 100644 (file)
@@ -583,7 +583,7 @@ static void mbox_mailbox_close(struct mailbox *box)
                (void)mbox_sync(mbox, sync_flags);
 
        if (mbox->mbox_global_lock_id != 0)
-               (void)mbox_unlock(mbox, mbox->mbox_global_lock_id);
+               mbox_unlock(mbox, mbox->mbox_global_lock_id);
        if (mbox->keep_lock_to != NULL)
                timeout_remove(&mbox->keep_lock_to);
 
@@ -703,7 +703,7 @@ static void mbox_transaction_unlock(struct mailbox *box, unsigned int lock_id)
        struct mbox_mailbox *mbox = (struct mbox_mailbox *)box;
 
        if (lock_id != 0)
-               (void)mbox_unlock(mbox, lock_id);
+               mbox_unlock(mbox, lock_id);
        if (mbox->mbox_global_lock_id == 0) {
                i_assert(mbox->box.transaction_count > 0 ||
                         mbox->mbox_lock_type == F_UNLCK);
index 89b39b189f72a775244897af5b586c92cb022328..6a3381cb05097636917a0d3a26e2dc9cd7f569c8 100644 (file)
@@ -1687,7 +1687,7 @@ int mbox_sync_get_guid(struct mbox_mailbox *mbox)
                mbox_sync_index_update_ext_header(mbox, trans);
                ret = mail_index_transaction_commit(&trans);
        }
-       (void)mbox_unlock(mbox, lock_id);
+       mbox_unlock(mbox, lock_id);
        return ret;
 }
 
@@ -1804,7 +1804,7 @@ static int mbox_sync_int(struct mbox_mailbox *mbox, enum mbox_sync_flags flags,
                        return 0;
 
                /* have to sync to make sure offsets have stayed the same */
-               (void)mbox_unlock(mbox, *lock_id);
+               mbox_unlock(mbox, *lock_id);
                *lock_id = 0;
        }
 
@@ -1989,7 +1989,7 @@ int mbox_sync(struct mbox_mailbox *mbox, enum mbox_sync_flags flags)
        if (lock_id != 0) {
                if (ret < 0) {
                        /* syncing failed, don't leave it locked */
-                       (void)mbox_unlock(mbox, lock_id);
+                       mbox_unlock(mbox, lock_id);
                } else if ((flags & MBOX_SYNC_LOCK_READING) == 0) {
                        if (mbox_unlock(mbox, lock_id) < 0)
                                ret = -1;
index 7dbb2670a277da78cd7964b6247510a303f37049..23b21dd0a22c2990f0d0260af79c0dfa45e06b8a 100644 (file)
@@ -486,8 +486,8 @@ static int pop3c_client_ssl_init(struct pop3c_client *client)
 
        if (*client->set.rawlog_dir != '\0' &&
            stat(client->set.rawlog_dir, &st) == 0) {
-               (void)iostream_rawlog_create(client->set.rawlog_dir,
-                                            &client->input, &client->output);
+               iostream_rawlog_create(client->set.rawlog_dir,
+                                      &client->input, &client->output);
        }
        return 0;
 }
@@ -533,8 +533,8 @@ static void pop3c_client_connect_ip(struct pop3c_client *client)
        if (*client->set.rawlog_dir != '\0' &&
            client->set.ssl_mode != POP3C_CLIENT_SSL_MODE_IMMEDIATE &&
            stat(client->set.rawlog_dir, &st) == 0) {
-               (void)iostream_rawlog_create(client->set.rawlog_dir,
-                                            &client->input, &client->output);
+               iostream_rawlog_create(client->set.rawlog_dir,
+                                      &client->input, &client->output);
        }
        client->io = io_add(client->fd, IO_WRITE,
                            pop3c_client_connected, client);
index ab321ef06edf525d940f90588c0ac82187011497..8e7022a62ade67a2cdd344ca2dff20912fb4fd66 100644 (file)
@@ -181,7 +181,7 @@ int subsfile_set_subscribed(struct mailbox_list *list, const char *path,
        o_stream_destroy(&output);
 
        if (failed || !changed) {
-               if (file_dotlock_delete_verified(&dotlock) < 0) {
+               if (file_dotlock_delete(&dotlock) < 0) {
                        subswrite_set_syscall_error(list,
                                "file_dotlock_delete()", path);
                        failed = TRUE;
index e72d5ebc7b176287c3673309b2fa9d66251d6468..6aaa012e7f0e541bc77522386098e733b7a2c8ea 100644 (file)
@@ -561,7 +561,7 @@ enum mail_error mailbox_get_last_mail_error(struct mailbox *box)
 {
        enum mail_error error;
 
-       (void)mail_storage_get_last_error(box->storage, &error);
+       mail_storage_get_last_error(box->storage, &error);
        return error;
 }
 
index a14d20f931f023dfcb712ba65adf55831469de2d..6be33f2abd0303edb24704d58c949a5f5f9a169e 100644 (file)
@@ -374,11 +374,13 @@ void mail_storage_set_callbacks(struct mail_storage *storage,
 int mail_storage_purge(struct mail_storage *storage);
 
 /* Returns the error message of last occurred error. */
-const char *mail_storage_get_last_error(struct mail_storage *storage,
-                                       enum mail_error *error_r) ATTR_NULL(2);
+const char * ATTR_NOWARN_UNUSED_RESULT
+mail_storage_get_last_error(struct mail_storage *storage,
+                           enum mail_error *error_r) ATTR_NULL(2);
 /* Wrapper for mail_storage_get_last_error(); */
-const char *mailbox_get_last_error(struct mailbox *box,
-                                  enum mail_error *error_r) ATTR_NULL(2);
+const char * ATTR_NOWARN_UNUSED_RESULT
+mailbox_get_last_error(struct mailbox *box, enum mail_error *error_r)
+       ATTR_NULL(2);
 /* Wrapper for mail_storage_get_last_error(); */
 enum mail_error mailbox_get_last_mail_error(struct mailbox *box);
 
index a75971e5a42e5d64947656443dd6e5a8f8118cf8..a2b326fa5e49e310fddea6e1dfd3b4ad474f3f27 100644 (file)
@@ -310,7 +310,8 @@ int mailbox_list_delete_dir(struct mailbox_list *list, const char *name);
 int mailbox_list_delete_symlink(struct mailbox_list *list, const char *name);
 
 /* Returns the error message of last occurred error. */
-const char *mailbox_list_get_last_error(struct mailbox_list *list,
-                                       enum mail_error *error_r);
+const char * ATTR_NOWARN_UNUSED_RESULT
+mailbox_list_get_last_error(struct mailbox_list *list,
+                           enum mail_error *error_r);
 
 #endif
index b25c6f509eb3b0de0be2dd90fb4e6c92e0e2cd03..be69d8ff6057a6bff7c7308a37d86185e3443a66 100644 (file)
@@ -85,7 +85,7 @@ struct istream *test_istream_create_data(const void *data, size_t size)
 
        tstream->istream.istream.blocking = FALSE;
        tstream->istream.istream.seekable = TRUE;
-       (void)i_stream_create(&tstream->istream, NULL, -1);
+       i_stream_create(&tstream->istream, NULL, -1);
        tstream->istream.statbuf.st_size = tstream->max_pos = size;
        tstream->allow_eof = TRUE;
        tstream->istream.max_buffer_size = (size_t)-1;
index ab051ed2dbd1cdc5e3702c645e59a92162e6ffb6..0eded217b2884ae4969c6c94d1b81668733f6531 100644 (file)
 /* If key is found, returns TRUE and sets idx_r to the position where the key
    was found. If key isn't found, returns FALSE and sets idx_r to the position
    where the key should be inserted. */
-bool bsearch_insert_pos(const void *key, const void *base, unsigned int nmemb,
+bool ATTR_NOWARN_UNUSED_RESULT
+bsearch_insert_pos(const void *key, const void *base, unsigned int nmemb,
                        size_t size, int (*cmp)(const void *, const void *),
                        unsigned int *idx_r);
 
-bool array_bsearch_insert_pos_i(const struct array *array, const void *key,
-                               int (*cmp)(const void *, const void *),
-                               unsigned int *idx_r);
+bool ATTR_NOWARN_UNUSED_RESULT
+array_bsearch_insert_pos_i(const struct array *array, const void *key,
+                          int (*cmp)(const void *, const void *),
+                          unsigned int *idx_r);
 #ifdef CONTEXT_TYPE_SAFETY
 #define array_bsearch_insert_pos(array, key, cmp, idx_r) \
        ({(void)(1 ? 0 : cmp(key, ARRAY_TYPE_CAST_CONST(array)NULL)); \
index bf6b9cbd07e2e9f84bf721e763b13b4becc8b6b6..b5bc57ad62e82d03df1e0e9910b294e3f7c63e82 100644 (file)
@@ -721,12 +721,7 @@ static bool file_dotlock_has_mtime_changed(time_t t1, time_t t2)
        return diff > FILE_DOTLOCK_MAX_STAT_MTIME_DIFF;
 }
 
-void file_dotlock_delete(struct dotlock **dotlock_p)
-{
-       (void)file_dotlock_delete_verified(dotlock_p);
-}
-
-int file_dotlock_delete_verified(struct dotlock **dotlock_p)
+int file_dotlock_delete(struct dotlock **dotlock_p)
 {
        struct dotlock *dotlock;
        const char *lock_path;
index d74032509e3f6c7bdccd1ab7f7f231c3ed59879a..c2e21312bc83294f903554ce9ff44558434cf3f1 100644 (file)
@@ -58,11 +58,10 @@ int file_dotlock_create(const struct dotlock_settings *set, const char *path,
                        enum dotlock_create_flags flags,
                        struct dotlock **dotlock_r);
 
-/* Delete the dotlock file, ignoring any potential errors. */
-void file_dotlock_delete(struct dotlock **dotlock);
 /* Delete the dotlock file. Returns 1 if successful, 0 if the file had already
    been deleted or reused by someone else, -1 if I/O error. */
-int file_dotlock_delete_verified(struct dotlock **dotlock);
+int ATTR_NOWARN_UNUSED_RESULT
+file_dotlock_delete(struct dotlock **dotlock);
 
 /* Use dotlock as the new content for file. This provides read safety without
    locks, but it's not very good for large files. Returns fd for lock file.
index 70a5a469a7d02ad24ecfbe4075d2325731d61b24..08c2759a2b0bb10b0cebfcb14b084f19a25e05e1 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef IOSTREAM_RAWLOG_H
 #define IOSTREAM_RAWLOG_H
 
-int iostream_rawlog_create(const char *dir, struct istream **input,
-                          struct ostream **output);
+int ATTR_NOWARN_UNUSED_RESULT
+iostream_rawlog_create(const char *dir, struct istream **input,
+                      struct ostream **output);
 
 #endif
index 27957c6a7324e057a3d5c40101d498aaeb5b0d9c..2519dc7feb6a953ed1fc84ad4e8bbbd895694b8b 100644 (file)
@@ -62,7 +62,7 @@ i_stream_base64_try_encode_line(struct base64_encoder_istream *bstream)
                bstream->cur_line_len = 0;
        }
 
-       (void)i_stream_get_buffer_space(stream, (size+2)/3*4, &avail);
+       i_stream_get_buffer_space(stream, (size+2)/3*4, &avail);
        buffer_avail = stream->buffer_size - stream->pos;
 
        if ((size + 2) / 3 * 4 > buffer_avail) {
index ca93891df70b13d8a2c32fdbb4b134654e72cd34..f510f6bd4cc514af52b2fb467ffa525b5d92a74f 100644 (file)
@@ -31,7 +31,7 @@ struct istream *i_stream_create_from_data(const void *data, size_t size)
        stream->istream.readable_fd = FALSE;
        stream->istream.blocking = TRUE;
        stream->istream.seekable = TRUE;
-       (void)i_stream_create(stream, NULL, -1);
+       i_stream_create(stream, NULL, -1);
        stream->statbuf.st_size = size;
        return &stream->istream;
 }
index abb8c425f798bdce4ddfa40dd75456a789aabde9..ac367877129efd8dbbc35efb7420924053b35082 100644 (file)
@@ -47,14 +47,15 @@ struct istream_private {
        unsigned int return_nolf_line:1;
 };
 
-struct istream *
+struct istream * ATTR_NOWARN_UNUSED_RESULT
 i_stream_create(struct istream_private *stream, struct istream *parent, int fd)
        ATTR_NULL(2);
 
 void i_stream_compress(struct istream_private *stream);
 void i_stream_grow_buffer(struct istream_private *stream, size_t bytes);
-bool i_stream_get_buffer_space(struct istream_private *stream,
-                              size_t wanted_size, size_t *size_r);
+bool ATTR_NOWARN_UNUSED_RESULT
+i_stream_get_buffer_space(struct istream_private *stream,
+                         size_t wanted_size, size_t *size_r);
 ssize_t i_stream_read_copy_from_parent(struct istream *istream);
 void i_stream_default_seek(struct istream_private *stream,
                           uoff_t v_offset, bool mark);
index a28fd57ae0a85af5b0986066a0ddd59951167ada..bfbf04064ac282912340eb4dcca9857b8761a1a4 100644 (file)
@@ -521,7 +521,7 @@ bool i_stream_add_data(struct istream *_stream, const unsigned char *data,
        struct istream_private *stream = _stream->real_stream;
        size_t size2;
 
-       (void)i_stream_get_buffer_space(stream, size, &size2);
+       i_stream_get_buffer_space(stream, size, &size2);
        if (size > size2)
                return FALSE;
 
index 2f5bfb9fcf3759eb8b778fb05818676eef753d4f..d8dde534b981a9f7af0392c48ec2ef32e5e59256 100644 (file)
@@ -75,7 +75,7 @@ void net_disconnect(int fd);
 void net_set_nonblock(int fd, bool nonblock);
 /* Set TCP_CORK if supported, ie. don't send out partial frames.
    Returns 0 if ok, -1 if failed. */
-int net_set_cork(int fd, bool cork);
+int net_set_cork(int fd, bool cork) ATTR_NOWARN_UNUSED_RESULT;
 
 /* Set IP to contain INADDR_ANY for IPv4 or IPv6. The IPv6 any address may
    include IPv4 depending on the system (Linux yes, BSD no). */
index b4e43a73ba42574b3f66d4a8ff91e494939e039e..ed0a1f9021880c1cd3c06e3c00408debb0c04460 100644 (file)
@@ -574,7 +574,7 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply,
                return;
        }
 
-       (void)client_unref(&client);
+       client_unref(&client);
 }
 
 int client_auth_begin(struct client *client, const char *mech_name,
index 1596eaa2469e3900a7c383409b1241b92f5926ad..1e73edcb38d6f45d6dab560fb16b0d84ce4b9524 100644 (file)
@@ -171,7 +171,7 @@ void client_destroy_success(struct client *client, const char *reason);
 void client_destroy_internal_failure(struct client *client);
 
 void client_ref(struct client *client);
-bool client_unref(struct client **client);
+bool client_unref(struct client **client) ATTR_NOWARN_UNUSED_RESULT;
 
 void client_cmd_starttls(struct client *client);
 
index d6503dc901404a48ffcc5d95c6bb8f65984427ee..8f3a78aacf76291b608766f4da05145ca3fbaa9c 100644 (file)
@@ -383,7 +383,7 @@ login_proxy_free_reason(struct login_proxy **_proxy, const char *reason)
        i_free(proxy);
 
        client->login_proxy = NULL;
-       (void)client_unref(&client);
+       client_unref(&client);
 }
 
 void login_proxy_free(struct login_proxy **_proxy)
index da76e352473bc6315c1874a5ff6e3557612f0530..099fe7e75398874c00a2df05fd29fa52754072d1 100644 (file)
@@ -149,8 +149,8 @@ static int ssl_proxy_destroy(struct ssl_proxy *proxy)
        if (proxy->io_plain != NULL)
                io_remove(proxy->io_plain);
 
-       (void)net_disconnect(proxy->fd_ssl);
-       (void)net_disconnect(proxy->fd_plain);
+       net_disconnect(proxy->fd_ssl);
+       net_disconnect(proxy->fd_plain);
 
        i_free(proxy);
 
index a25acf1d9f5ebbb92819b1478d61fcaa7d637084..88de0def032386543db9a4fb0db1881996a291c8 100644 (file)
@@ -319,7 +319,7 @@ static void plain_read(struct ssl_proxy *proxy)
        }
 
        if (corked)
-               (void)net_set_cork(proxy->fd_ssl, FALSE);
+               net_set_cork(proxy->fd_ssl, FALSE);
 
        ssl_proxy_unref(proxy);
 }
@@ -536,9 +536,9 @@ static void ssl_step(struct ssl_proxy *proxy)
                if (proxy->sslout_size == 0)
                        ssl_set_io(proxy, SSL_REMOVE_OUTPUT);
                else {
-                       (void)net_set_cork(proxy->fd_ssl, TRUE);
+                       net_set_cork(proxy->fd_ssl, TRUE);
                        ssl_write(proxy);
-                       (void)net_set_cork(proxy->fd_ssl, FALSE);
+                       net_set_cork(proxy->fd_ssl, FALSE);
                }
        }
 
@@ -802,11 +802,11 @@ static void ssl_proxy_destroy(struct ssl_proxy *proxy)
 
        (void)SSL_shutdown(proxy->ssl);
 
-       (void)net_disconnect(proxy->fd_ssl);
-       (void)net_disconnect(proxy->fd_plain);
+       net_disconnect(proxy->fd_ssl);
+       net_disconnect(proxy->fd_plain);
 
        if (proxy->client != NULL)
-               (void)client_unref(&proxy->client);
+               client_unref(&proxy->client);
        ssl_proxy_unref(proxy);
 }
 
index 51836aa72cbdcefa2726c702751eb8c440d78030..ef6445b2c4e6eec5e198e0483805c598230a2bad 100644 (file)
@@ -198,7 +198,7 @@ fts_backend_lucene_get_last_uid(struct fts_backend *_backend,
        if (lucene_index_get_last_uid(backend->index, last_uid_r) < 0)
                return -1;
 
-       (void)fts_index_set_last_uid(box, *last_uid_r);
+       fts_index_set_last_uid(box, *last_uid_r);
        return 0;
 }
 
@@ -290,7 +290,7 @@ fts_backend_lucene_update_set_mailbox(struct fts_backend_update_context *_ctx,
                (struct lucene_fts_backend_update_context *)_ctx;
 
        if (ctx->last_uid != 0) {
-               (void)fts_index_set_last_uid(ctx->box, ctx->last_uid);
+               fts_index_set_last_uid(ctx->box, ctx->last_uid);
                ctx->last_uid = 0;
        }
        if (ctx->first_box_vname == NULL)
index 7e713c9984129266ed523f745b23fd408c89197b..1527ca84e5c2e4b7e2139d4645cffb565661706c 100644 (file)
@@ -349,7 +349,7 @@ fts_backend_solr_get_last_uid(struct fts_backend *_backend,
        if (fts_backend_solr_get_last_uid_fallback(backend, box, last_uid_r) < 0)
                return -1;
 
-       (void)fts_index_set_last_uid(box, *last_uid_r);
+       fts_index_set_last_uid(box, *last_uid_r);
        return 0;
 }
 
@@ -468,7 +468,7 @@ fts_backend_solr_update_set_mailbox(struct fts_backend_update_context *_ctx,
        struct mail_namespace *ns;
 
        if (ctx->prev_uid != 0) {
-               (void)fts_index_set_last_uid(ctx->cur_box, ctx->prev_uid);
+               fts_index_set_last_uid(ctx->cur_box, ctx->prev_uid);
                ctx->prev_uid = 0;
        }
 
index 6254b2f68961ebee043fef1969c81578b694ca03..be5d43217776089d8c46a1f98961a7281c48ace6 100644 (file)
@@ -229,7 +229,7 @@ fts_backend_solr_get_last_uid(struct fts_backend *_backend,
        if (get_last_uid_fallback(_backend, box, last_uid_r) < 0)
                return -1;
 
-       (void)fts_index_set_last_uid(box, *last_uid_r);
+       fts_index_set_last_uid(box, *last_uid_r);
        return 0;
 }
 
@@ -367,7 +367,7 @@ fts_backend_solr_update_set_mailbox(struct fts_backend_update_context *_ctx,
        const char *box_guid;
 
        if (ctx->prev_uid != 0) {
-               (void)fts_index_set_last_uid(ctx->cur_box, ctx->prev_uid);
+               fts_index_set_last_uid(ctx->cur_box, ctx->prev_uid);
                ctx->prev_uid = 0;
        }
 
index 05e43f1a4955feb27208f054c0863f5869671b68..70d164e84d3d57f42d6dc73ff78c51d73d415c4b 100644 (file)
@@ -105,7 +105,8 @@ void fts_filter_uids(ARRAY_TYPE(seq_range) *definite_dest,
 bool fts_index_get_header(struct mailbox *box, struct fts_index_header *hdr_r);
 int fts_index_set_header(struct mailbox *box,
                         const struct fts_index_header *hdr);
-int fts_index_set_last_uid(struct mailbox *box, uint32_t last_uid);
+int ATTR_NOWARN_UNUSED_RESULT
+fts_index_set_last_uid(struct mailbox *box, uint32_t last_uid);
 int fts_index_have_compatible_settings(struct mailbox_list *list,
                                       uint32_t checksum);
 
index 2109f62b4dc576669c239ea3a3d44880bc7b4a28..65ff6cdfe13a62d5d43036d58c7cb03dcd41972d 100644 (file)
@@ -343,7 +343,7 @@ bool fts_index_get_header(struct mailbox *box, struct fts_index_header *hdr_r)
        size_t data_size;
        bool ret;
 
-       (void)mail_index_refresh(box->index);
+       mail_index_refresh(box->index);
        view = mail_index_view_open(box->index);
        mail_index_get_header_ext(view, fts_index_get_ext_id(box),
                                  &data, &data_size);
index bc0631f6932959d41bfa130846f25dd02b49de4b..4edc2b50a012ef3dc74bcf7ee95e062c2d0ab5d2 100644 (file)
@@ -169,7 +169,7 @@ static void parse_content_disposition(const char *content_disposition,
        if (rfc822_parse_mime_token(&parser, str) < 0)
                return;
 
-       (void)rfc2231_parse(&parser, &results);
+       rfc2231_parse(&parser, &results);
        filename2 = NULL;
        for (; *results != NULL; results += 2) {
                if (strcasecmp(results[0], "filename") == 0) {
index 2b390e0c3a5b4255ebdcf57ec6cc5f6a5ea92c46..cd11fa6db3c165901395c4ed710642594f77e5c8 100644 (file)
@@ -203,7 +203,6 @@ fts_mailbox_search_init(struct mailbox_transaction_context *t,
 static bool fts_mailbox_build_continue(struct mail_search_context *ctx)
 {
        struct fts_search_context *fctx = FTS_CONTEXT(ctx);
-       enum mail_error error;
        int ret;
 
        ret = fts_indexer_more(fctx->indexer_ctx);
@@ -224,8 +223,8 @@ static bool fts_mailbox_build_continue(struct mail_search_context *ctx)
 
                   if indexing failed for any other reason, just
                   fallback to searching the slow way. */
-               (void)mailbox_get_last_error(fctx->box, &error);
-               fctx->indexing_timed_out = error == MAIL_ERROR_INUSE;
+               fctx->indexing_timed_out =
+                       mailbox_get_last_mail_error(fctx->box) == MAIL_ERROR_INUSE;
        }
        return TRUE;
 }
index 36869a5837aa6f2e4ba8e6e6fbfce9f774312155..4669998dab08deffc617935c9f7d6d794e0a6762 100644 (file)
@@ -687,7 +687,7 @@ void imap_acl_plugin_deinit(void)
        command_unregister("DELETEACL");
        command_unregister("LISTRIGHTS");
 
-       (void)imap_client_created_hook_set(next_hook_client_created);
+       imap_client_created_hook_set(next_hook_client_created);
 }
 
 const char *imap_acl_plugin_dependencies[] = { "acl", NULL };
index e3b9e79670972fa533055dd53eb5d5fb2fbfe5d2..a3e4f672e39354861b429225d45f472c32070ac3 100644 (file)
@@ -230,7 +230,7 @@ void imap_quota_plugin_deinit(void)
        command_unregister("GETQUOTA");
        command_unregister("SETQUOTA");
 
-       (void)imap_client_created_hook_set(next_hook_client_created);
+       imap_client_created_hook_set(next_hook_client_created);
 }
 
 const char *imap_quota_plugin_dependencies[] = { "quota", NULL };
index c28821bbc8d6f88cf91f455a19307caa8abb999f..dfa1f9c53f5e67617d31b82a470b390c515022e7 100644 (file)
@@ -153,7 +153,7 @@ void imap_zlib_plugin_deinit(void)
 {
        command_unregister("COMPRESS");
 
-       (void)imap_client_created_hook_set(next_hook_client_created);
+       imap_client_created_hook_set(next_hook_client_created);
 }
 
 const char *imap_zlib_plugin_dependencies[] = { "zlib", NULL };
index b41407743330981e5beea06bb783ba34605a0ebe..48fe679bcef6a9108b286680c4fa8dbc68e89e41 100644 (file)
@@ -77,7 +77,6 @@ static void client_idle_timeout(struct client *client)
 static int
 pop3_mail_get_size(struct client *client, struct mail *mail, uoff_t *size_r)
 {
-       enum mail_error error;
        int ret;
 
        if (!client->set->pop3_fast_size_lookups)
@@ -90,8 +89,7 @@ pop3_mail_get_size(struct client *client, struct mail *mail, uoff_t *size_r)
        if (ret == 0)
                return 0;
 
-       (void)mailbox_get_last_error(mail->box, &error);
-       if (error != MAIL_ERROR_NOTPOSSIBLE)
+       if (mailbox_get_last_mail_error(mail->box) != MAIL_ERROR_NOTPOSSIBLE)
                return -1;
 
        /* virtual size not available with a fast lookup.
@@ -102,8 +100,7 @@ pop3_mail_get_size(struct client *client, struct mail *mail, uoff_t *size_r)
        if (ret == 0)
                return 0;
 
-       (void)mailbox_get_last_error(mail->box, &error);
-       if (error != MAIL_ERROR_NOTPOSSIBLE)
+       if (mailbox_get_last_mail_error(mail->box) != MAIL_ERROR_NOTPOSSIBLE)
                return -1;
 
        /* no way to quickly get the size. fallback to doing a slow virtual