]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Remove dead assignments
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 24 Mar 2020 10:21:26 +0000 (12:21 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 27 Mar 2020 14:29:33 +0000 (14:29 +0000)
Found by latest clang scan-build.

27 files changed:
src/auth/db-ldap.c
src/doveadm/dsync/test-dsync-mailbox-tree-sync.c
src/imap/cmd-subscribe.c
src/imap/imap-client-hibernate.c
src/lib-compression/test-compression.c
src/lib-dcrypt/dcrypt-openssl.c
src/lib-http/http-client-connection.c
src/lib-http/http-url.c
src/lib-imap-urlauth/imap-urlauth-connection.c
src/lib-imap/imap-url.c
src/lib-mail/message-part-data.c
src/lib-mail/rfc822-parser.c
src/lib-mail/test-message-parser.c
src/lib-smtp/smtp-params.c
src/lib-smtp/smtp-parser.c
src/lib-smtp/smtp-server-cmd-data.c
src/lib-smtp/smtp-syntax.c
src/lib-storage/list/mailbox-list-index-backend.c
src/lib-storage/list/mailbox-list-index-status.c
src/lib-storage/list/mailbox-list-subscriptions.c
src/lib/uri-util.c
src/lib/var-expand.c
src/lmtp/lmtp-local.c
src/log/doveadm-connection.c
src/master/test-auth-master.c
src/plugins/fts/fts-expunge-log.c
src/plugins/mail-crypt/doveadm-mail-crypt.c

index 84754e7506c6f71cde872ec06b3e722349f4c060..7b2d3201607d0f60c7eab504acb972818d93ce92 100644 (file)
@@ -1670,10 +1670,9 @@ db_ldap_field_ptr_expand(const char *data, void *context,
 {
        struct db_ldap_result_iterate_context *ctx = context;
        const char *field_name, *suffix;
-       int ret;
 
        suffix = strchr(t_strcut(data, ':'), '@');
-       if ((ret = db_ldap_field_expand(data, ctx, &field_name, error_r)) <= 0)
+       if (db_ldap_field_expand(data, ctx, &field_name, error_r) <= 0)
                i_unreached();
        if (field_name[0] == '\0') {
                *value_r = "";
index ec58d23a28e9e959591fb1f23e916e2cc3b89325..b81ca9c5ff3197c355fbe3bd50b453fd5587288e 100644 (file)
@@ -171,7 +171,6 @@ static void test_trees_nofree(struct dsync_mailbox_tree *tree1,
        struct dsync_mailbox_tree *orig_tree1, *orig_tree2;
        struct dsync_mailbox_tree_sync_ctx *ctx;
        struct dsync_mailbox_node *dup_node1, *dup_node2;
-       const struct dsync_mailbox_tree_sync_change *change;
 
        orig_tree1 = dsync_mailbox_tree_dup(tree1);
        orig_tree2 = dsync_mailbox_tree_dup(tree2);
@@ -182,7 +181,7 @@ static void test_trees_nofree(struct dsync_mailbox_tree *tree1,
        ctx = dsync_mailbox_trees_sync_init(tree1, tree2,
                                            DSYNC_MAILBOX_TREES_SYNC_TYPE_TWOWAY,
                                            DSYNC_MAILBOX_TREES_SYNC_FLAG_DEBUG);
-       while ((change = dsync_mailbox_trees_sync_next(ctx)) != NULL) {
+       while (dsync_mailbox_trees_sync_next(ctx) != NULL) {
        }
        dsync_mailbox_trees_sync_deinit(&ctx);
        test_tree_fixup(tree1);
@@ -197,7 +196,7 @@ static void test_trees_nofree(struct dsync_mailbox_tree *tree1,
        dsync_mailbox_tree_build_guid_hash(orig_tree2, &dup_node1, &dup_node2);
        ctx = dsync_mailbox_trees_sync_init(orig_tree2, orig_tree1,
                                            DSYNC_MAILBOX_TREES_SYNC_TYPE_TWOWAY, 0);
-       while ((change = dsync_mailbox_trees_sync_next(ctx)) != NULL) {
+       while (dsync_mailbox_trees_sync_next(ctx) != NULL) {
        }
        dsync_mailbox_trees_sync_deinit(&ctx);
        test_tree_fixup(orig_tree1);
index 761b47875ce7efb0c77dc505d7bb07a641230cef..ca7397beea428a5849e964f1d3ee7add24526e6c 100644 (file)
@@ -9,9 +9,8 @@ static bool
 subscribe_is_valid_name(struct client_command_context *cmd, struct mailbox *box)
 {
        enum mailbox_existence existence;
-       int ret;
 
-       if ((ret = mailbox_exists(box, TRUE, &existence)) < 0) {
+       if (mailbox_exists(box, TRUE, &existence) < 0) {
                client_send_box_error(cmd, box);
                return FALSE;
        }
index 210e1b6b4746a51881bbb6be1522826b44c0c050..40a05e2c46b86c20e3dddb601b96ca09d420864c 100644 (file)
@@ -117,7 +117,7 @@ imap_hibernate_process_send_cmd(int fd_socket, const char *path,
                return -1;
        }
        i_assert(ret == 1);
-       if ((ret = write_full(fd_socket, str_data(cmd)+1, str_len(cmd)-1)) < 0) {
+       if (write_full(fd_socket, str_data(cmd)+1, str_len(cmd)-1) < 0) {
                i_error("write(%s) failed: %m", path);
                return -1;
        }
index d1d48ad0901d5e24f47fbf91f7bebc3393c6a32a..dfd9dd8c0433d483c8274de414341d4e0a47da43 100644 (file)
@@ -736,7 +736,6 @@ static void test_compress_file(const char *in_path, const char *out_path)
        unsigned char output_sha1[SHA1_RESULTLEN], input_sha1[SHA1_RESULTLEN];
        const unsigned char *data;
        size_t size;
-       ssize_t ret;
 
        handler = compression_lookup_handler_from_ext(out_path);
        if (handler == NULL)
@@ -774,7 +773,7 @@ static void test_compress_file(const char *in_path, const char *out_path)
        sha1_init(&sha1);
        file_input = i_stream_create_fd(fd_out, IO_BLOCK_SIZE);
        input = handler->create_istream(file_input, TRUE);
-       while ((ret = i_stream_read_more(input, &data, &size)) > 0) {
+       while (i_stream_read_more(input, &data, &size) > 0) {
                sha1_loop(&sha1, data, size);
                i_stream_skip(input, size);
        }
index 251c7cfe0ffab0f974fa98ce71a500bf117abc9d..8a0ce1633d78e84a9bb6edfa17fb58965248fedc 100644 (file)
@@ -2750,12 +2750,12 @@ dcrypt_openssl_key_string_get_info(
                                *error_r = "Invalid JWK key: Missing kty parameter";
                        return FALSE;
                } else if (strcmp(value, "RSA") == 0) {
-                       if ((node = json_tree_find_key(root, "d")) != NULL)
+                       if (json_tree_find_key(root, "d") != NULL)
                                kind = DCRYPT_KEY_KIND_PRIVATE;
                        else
                                kind = DCRYPT_KEY_KIND_PUBLIC;
                } else if (strcmp(value, "EC") == 0) {
-                       if ((node = json_tree_find_key(root, "d")) != NULL)
+                       if (json_tree_find_key(root, "d") != NULL)
                                kind = DCRYPT_KEY_KIND_PRIVATE;
                        else
                                kind = DCRYPT_KEY_KIND_PUBLIC;
index ee10f34917c857018f43fd0da43de0092050b276..f0f1c66fdc435bf9770310a5b993f53458de64c1 100644 (file)
@@ -325,7 +325,6 @@ int http_client_connection_check_ready(struct http_client_connection *conn)
 {
        const struct http_client_settings *set =
                http_client_connection_get_settings(conn);
-       int ret;
 
        if (conn->in_req_callback) {
                /* this can happen when a nested ioloop is created inside request
@@ -347,7 +346,7 @@ int http_client_connection_check_ready(struct http_client_connection *conn)
                /* Active ioloop is different from what we saw earlier;
                   we may have missed a disconnection event on this connection.
                   Verify status by reading from connection. */
-               if ((ret=i_stream_read(conn->conn.input)) == -1) {
+               if (i_stream_read(conn->conn.input) == -1) {
                        int stream_errno = conn->conn.input->stream_errno;
 
                        i_assert(conn->conn.input->stream_errno != 0 || conn->conn.input->eof);
index 78af18babf31ca6c5a047d48f60c733a33899b9c..733e1097c2ffa5e9c8e02409d7d6c0b004f33bd0 100644 (file)
@@ -33,13 +33,12 @@ static bool
 http_url_parse_scheme(struct http_url_parser *url_parser, const char **scheme_r)
 {
        struct uri_parser *parser = &url_parser->parser;
-       int ret;
 
        *scheme_r = NULL;
        if ((url_parser->flags & HTTP_URL_PARSE_SCHEME_EXTERNAL) != 0)
                return TRUE;
 
-       if ((ret = uri_parse_scheme(parser, scheme_r)) <= 0) {
+       if (uri_parse_scheme(parser, scheme_r) <= 0) {
                parser->cur = parser->begin;
                return FALSE;
        }
index 28137032710d2506937b4053652601e7692d13c1..6bf00e806ff6733d8b5b5aea01f0a6e745c6b68d 100644 (file)
@@ -848,8 +848,6 @@ static int imap_urlauth_input_next(struct imap_urlauth_connection *conn)
 
 static void imap_urlauth_input(struct imap_urlauth_connection *conn)
 {
-       int ret;
-
        i_assert(conn->state != IMAP_URLAUTH_STATE_DISCONNECTED);
 
        if (conn->input->closed) {
@@ -873,7 +871,7 @@ static void imap_urlauth_input(struct imap_urlauth_connection *conn)
        }
 
        while (!conn->input->closed) {
-               if ((ret = imap_urlauth_input_next(conn)) <= 0)
+               if (imap_urlauth_input_next(conn) <= 0)
                        break;
        }
 }
index a456e38e0d37826f76b5ac965dce881bdc0935ff..6da6e21752832157243c7febfc7ed46decfe40fa 100644 (file)
@@ -847,8 +847,8 @@ static bool imap_url_do_parse(struct imap_url_parser *url_parser)
 
        /* Parse path, i.e. `[ icommand ]` from `*( "/" segment )` */
        if (ret > 0 || url_parser->relative) {
-               if ((ret = imap_url_parse_path(url_parser, path, relative,
-                                              &is_messagelist)) < 0)
+               if (imap_url_parse_path(url_parser, path, relative,
+                                       &is_messagelist) < 0)
                        return FALSE;
        }
 
index 94f97fad36c7b411bd6201244c2a10ac8b22150b..a5771f87e2e9e2203aac0f1144fe2117a04a1df4 100644 (file)
@@ -488,8 +488,7 @@ void message_part_data_parse_from_header(pool_t pool,
                if (part->data == NULL) {
                        /* no Content-* headers. add an empty context
                           structure anyway. */
-                       part->data = part_data =
-                               p_new(pool, struct message_part_data, 1);
+                       part->data = p_new(pool, struct message_part_data, 1);
                } else if ((part->flags & MESSAGE_PART_FLAG_IS_MIME) == 0) {
                        /* If there was no Mime-Version, forget all
                           the Content-stuff */
@@ -512,8 +511,7 @@ void message_part_data_parse_from_header(pool_t pool,
 
        if (part->data == NULL) {
                /* initialize message part data */
-               part->data = part_data =
-                       p_new(pool, struct message_part_data, 1);
+               part->data = p_new(pool, struct message_part_data, 1);
        }
        part_data = part->data;
 
index bb73b8d76fb28fc685fe443df1243431bdf6a6fc..f87866f4428f28ad995228f699bb4f5809211c37 100644 (file)
@@ -212,7 +212,7 @@ int rfc822_parse_dot_atom(struct rfc822_parser_context *ctx, string_t *str)
                ctx->data++;
                str_append_c(str, '.');
 
-               if ((ret = rfc822_skip_lwsp(ctx)) <= 0)
+               if (rfc822_skip_lwsp(ctx) <= 0)
                        return -1;
                start = ctx->data;
        }
index 373ff01eb01d841c3d4f13a5162b51be526b1ba9..4f4d68408305dc2c5fc707f6d095c545b35e3666 100644 (file)
@@ -75,7 +75,6 @@ static void test_parsed_parts(struct istream *input, struct message_part *parts)
        struct message_part *parts2;
        uoff_t i, input_size;
        const char *error;
-       int ret;
 
        i_stream_seek(input, 0);
        if (i_stream_get_size(input, TRUE, &input_size) < 0)
@@ -87,8 +86,7 @@ static void test_parsed_parts(struct istream *input, struct message_part *parts)
                test_istream_set_size(input, i/2);
                if (i > TEST_MSG_LEN*2)
                        test_istream_set_allow_eof(input, TRUE);
-               while ((ret = message_parser_parse_next_block(parser,
-                                                             &block)) > 0) ;
+               while (message_parser_parse_next_block(parser, &block) > 0) ;
        }
        test_assert(message_parser_deinit_from_parts(&parser, &parts2, &error) == 0);
        test_assert(msg_parts_cmp(parts, parts2));
index c1293a9913af4e57c1714904230d84fef42087b4..620fe3d3dd6d84fe780b2c597cbebf7d51ca2527 100644 (file)
@@ -69,7 +69,6 @@ int smtp_param_parse(pool_t pool, const char *text,
                     struct smtp_param *param_r, const char **error_r)
 {
        struct smtp_parser parser;
-       int ret;
 
        i_zero(param_r);
 
@@ -81,7 +80,7 @@ int smtp_param_parse(pool_t pool, const char *text,
 
        smtp_parser_init(&parser, pool, text);
 
-       if ((ret = smtp_param_do_parse(&parser, param_r)) <= 0) {
+       if (smtp_param_do_parse(&parser, param_r) <= 0) {
                if (error_r != NULL)
                        *error_r = parser.error;
                return -1;
index 8bddc9944eaa2f4c0c72c18b7a966b56a52b5b2d..a704698b11c3c5b6836c706985ceb0d88a6e2c9c 100644 (file)
@@ -277,8 +277,7 @@ smtp_parser_parse_ipv4_address(struct smtp_parser *parser,
                        str_append_c(literal, '.');
                parser->cur++;
 
-               if ((ret = smtp_parser_parse_snum(parser,
-                       literal, &octet)) <= 0)
+               if (smtp_parser_parse_snum(parser, literal, &octet) <= 0)
                        return -1;
                ip = (ip << 8) + octet;
        }
@@ -349,7 +348,7 @@ int smtp_parser_parse_address_literal(struct smtp_parser *parser,
                        tagbuf = t_str_new(16);
                        str_append_c(tagbuf, '[');
                }
-               if ((ret=smtp_parser_parse_ldh_str(parser, tagbuf)) <= 0 ||
+               if (smtp_parser_parse_ldh_str(parser, tagbuf) <= 0 ||
                        parser->cur >= parser->end || *parser->cur != ':') {
                        parser->error = "Invalid address literal";
                        return -1;
@@ -381,8 +380,8 @@ int smtp_parser_parse_address_literal(struct smtp_parser *parser,
 
                if (ipv6) {
                        i_zero(&ip6);
-                       if ((ret = inet_pton(AF_INET6, t_strndup(pblock,
-                               parser->cur - pblock), &ip6)) <= 0) {
+                       if (inet_pton(AF_INET6, t_strndup(pblock,
+                               parser->cur - pblock), &ip6) <= 0) {
                                parser->error = "Invalid IPv6 address literal";
                                return -1;
                        }
index 7d81d927f0f7c13bcd5a244156b861062639c6ae..1979a5001e312b6257eb12a55ac740334ad16252 100644 (file)
@@ -352,7 +352,6 @@ cmd_data_next(struct smtp_server_cmd_ctx *cmd,
        struct smtp_server_transaction *trans = conn->state.trans;
        const struct smtp_server_callbacks *callbacks = conn->callbacks;
        struct smtp_server_command *command = cmd->cmd;
-       int ret;
 
        /* this command is next to send a reply */
 
@@ -402,8 +401,8 @@ cmd_data_next(struct smtp_server_cmd_ctx *cmd,
                smtp_server_command_ref(cmd_temp);
                i_assert(callbacks != NULL &&
                         callbacks->conn_cmd_data_begin != NULL);
-               if ((ret=callbacks->conn_cmd_data_begin(conn->context,
-                       cmd, conn->state.trans, conn->state.data_input)) < 0) {
+               if (callbacks->conn_cmd_data_begin(conn->context,
+                       cmd, conn->state.trans, conn->state.data_input) < 0) {
                        i_assert(smtp_server_command_is_replied(cmd_temp));
                        /* command failed */
                        smtp_server_command_unref(&cmd_temp);
index 5d22445f7283b635204f5bb8969bf9910f41097d..fdf5bdee2099e834480b13276353fd361b1d1627 100644 (file)
@@ -17,7 +17,6 @@ int smtp_string_parse(const char *string,
        const char **value_r, const char **error_r)
 {
        struct smtp_parser parser;
-       int ret;
 
        if (string == NULL || *string == '\0') {
                *value_r = "";
@@ -26,7 +25,7 @@ int smtp_string_parse(const char *string,
 
        smtp_parser_init(&parser, pool_datastack_create(), string);
 
-       if ((ret=smtp_parser_parse_string(&parser, value_r)) < 0) {
+       if (smtp_parser_parse_string(&parser, value_r) < 0) {
                if (error_r != NULL)
                        *error_r = parser.error;
                return -1;
@@ -85,7 +84,6 @@ int smtp_xtext_parse(const char *xtext,
 {
        struct smtp_parser parser;
        string_t *value = NULL;
-       int ret;
 
        if (xtext == NULL || *xtext == '\0') {
                *value_r = "";
@@ -96,7 +94,7 @@ int smtp_xtext_parse(const char *xtext,
                value = t_str_new(256);
        smtp_parser_init(&parser, pool_datastack_create(), xtext);
 
-       if ((ret=smtp_parser_parse_xtext(&parser, value)) < 0) {
+       if (smtp_parser_parse_xtext(&parser, value) < 0) {
                if (error_r != NULL)
                        *error_r = parser.error;
                return -1;
@@ -297,7 +295,6 @@ int smtp_ehlo_line_parse(const char *ehlo_line, const char **key_r,
        const char *const **params_r, const char **error_r)
 {
        struct smtp_parser parser;
-       int ret;
 
        if (ehlo_line == NULL || *ehlo_line == '\0') {
                if (error_r != NULL)
@@ -307,7 +304,7 @@ int smtp_ehlo_line_parse(const char *ehlo_line, const char **key_r,
 
        smtp_parser_init(&parser, pool_datastack_create(), ehlo_line);
 
-       if ((ret=smtp_parse_ehlo_line(&parser, key_r, params_r)) <= 0) {
+       if (smtp_parse_ehlo_line(&parser, key_r, params_r) <= 0) {
                if (error_r != NULL)
                        *error_r = parser.error;
                return -1;
index ad3f62a1ced4922d54bb03a51a46e4ffb055e189..c662a13af2df1d18a5456d7b32bfcd6c9d8ad35e 100644 (file)
@@ -352,7 +352,7 @@ index_list_mailbox_create(struct mailbox *box,
        int ret;
 
        /* first do a quick check that it doesn't exist */
-       if ((ret = index_list_node_exists(list, box->name, &existence)) < 0) {
+       if (index_list_node_exists(list, box->name, &existence) < 0) {
                mail_storage_copy_list_error(box->storage, box->list);
                return -1;
        }
index 7a0a0a6ed52c163cad09e377d21306269a1d2aa8..45f079bd534e3d05c84d5e0f8f5c57a4e5a25177 100644 (file)
@@ -36,9 +36,8 @@ index_list_exists(struct mailbox *box, bool auto_boxes,
        const struct mail_index_record *rec;
        enum mailbox_list_index_flags flags;
        uint32_t seq;
-       int ret;
 
-       if ((ret = mailbox_list_index_view_open(box, FALSE, &view, &seq)) <= 0) {
+       if (mailbox_list_index_view_open(box, FALSE, &view, &seq) <= 0) {
                /* failure / not found. fallback to the real storage check
                   just in case to see if the mailbox was just created. */
                return ibox->module_ctx.super.
@@ -652,12 +651,11 @@ void mailbox_list_index_update_mailbox_index(struct mailbox *box,
        struct mailbox_status status;
        guid_128_t mailbox_guid;
        bool guid_changed = FALSE;
-       int ret;
 
        i_zero(&changes);
        /* update the mailbox list index even if it has some other pending
           changes. */
-       if ((ret = mailbox_list_index_view_open(box, FALSE, &list_view, &changes.seq)) <= 0)
+       if (mailbox_list_index_view_open(box, FALSE, &list_view, &changes.seq) <= 0)
                return;
 
        guid_128_empty(mailbox_guid);
index f2cce85404be4860de64825541d9fea980e5653b..0123c8cb80be11e0798f252a9b76ddabf2916622 100644 (file)
@@ -80,7 +80,8 @@ mailbox_list_subscription_fill_one(struct mailbox_list *list,
                   it should be saved as "pub/", but handle it anyway */
                i_assert(strncmp(ns_name, ns->prefix, ns->prefix_len-1) == 0 &&
                         ns_name[ns->prefix_len-1] == '\0');
-               name = ns_name = "";
+               name = "";
+               /* ns_name = ""; */
        }
 
        len = strlen(name);
index 67adae8506b7f9aa0f3811b49535e5b58282accb..85664aedcc5d88c70e965bd08b8b7214bdfcefa2 100644 (file)
@@ -383,7 +383,7 @@ uri_parse_ipv4address(struct uri_parser *parser, string_t *literal,
                        str_append_c(literal, '.');
                parser->cur++;
 
-               if ((ret = uri_parse_dec_octet(parser, literal, &octet)) <= 0)
+               if (uri_parse_dec_octet(parser, literal, &octet) <= 0)
                        return -1;
                ip = (ip << 8) + octet;
        }
@@ -589,7 +589,6 @@ uri_parse_ip_literal(struct uri_parser *parser, string_t *literal,
        const unsigned char *p;
        const char *address;
        struct in6_addr ip6;
-       int ret;
 
        /* IP-literal    = "[" ( IPv6address / IPvFuture  ) "]"
         * IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
@@ -623,7 +622,7 @@ uri_parse_ip_literal(struct uri_parser *parser, string_t *literal,
                        "Future IP host address '%s' not supported", address);
                return -1;
        }
-       if ((ret = inet_pton(AF_INET6, address, &ip6)) <= 0) {
+       if (inet_pton(AF_INET6, address, &ip6) <= 0) {
                parser->error = p_strdup_printf(parser->pool,
                        "Invalid IPv6 host address '%s'", address);
                return -1;
@@ -656,7 +655,7 @@ uri_do_parse_host(struct uri_parser *parser,
 
        /* IP-literal / */
        if (parser->cur < parser->end && *parser->cur == '[') {
-               if ((ret=uri_parse_ip_literal(parser, literal, &ip6)) <= 0)
+               if (uri_parse_ip_literal(parser, literal, &ip6) <= 0)
                        return -1;
 
                if (host != NULL) {
index 11b930a77eadb62f7bf28c30ac433f1c3233de09..507fd891f09e1d675e9afdceb9181d73c4dc33b3 100644 (file)
@@ -553,7 +553,7 @@ int var_expand_with_funcs(string_t *dest, const char *str,
                                break;
 
                        var = NULL;
-                       if (*str == '{' && (end = strchr(str, '}')) != NULL) {
+                       if (*str == '{' && strchr(str, '}') != NULL) {
                                /* %{long_key} */
                                unsigned int ctr = 1;
                                bool escape = FALSE;
index 083636ea3e822a5ab9024149ec291b61c95d3b91..5cc29b40215f47e956e6213fb6a0441758d5de13 100644 (file)
@@ -241,9 +241,8 @@ lmtp_local_rcpt_anvil_finish(struct lmtp_local_recipient *llrcpt)
 {
        struct smtp_server_recipient *rcpt = llrcpt->rcpt->rcpt;
        struct smtp_server_cmd_ctx *cmd = rcpt->cmd;
-       int ret;
 
-       if ((ret = lmtp_local_rcpt_check_quota(llrcpt)) < 0)
+       if (lmtp_local_rcpt_check_quota(llrcpt) < 0)
                return FALSE;
 
        smtp_server_cmd_rcpt_reply_success(cmd);
index 8156ed61dcf77ccefbd441f5b348385bfe4e7494..6ad13ffd4327f9a89e8d26107029f57f35b6a344 100644 (file)
@@ -48,9 +48,7 @@ static int doveadm_connection_send_errors(struct doveadm_connection *conn)
 
 static int doveadm_output(struct doveadm_connection *conn)
 {
-       int ret;
-
-       if ((ret = o_stream_flush(conn->output)) != 0) {
+       if (o_stream_flush(conn->output) != 0) {
                /* error / finished */
                doveadm_connection_destroy(&conn);
        }
index 4578f62e0d0f2dab1e18aa42505392a50f73e747..d08b1781997898359e5a9f7aadf716a7aad01d1b 100644 (file)
@@ -1197,7 +1197,6 @@ static int test_client_user_list_simple(void)
        struct auth_master_user_list_ctx *list_ctx;
        enum auth_master_flags flags = 0;
        struct auth_user_info info;
-       const char *user;
        int ret;
 
        i_zero(&info);
@@ -1210,7 +1209,7 @@ static int test_client_user_list_simple(void)
        auth_conn = auth_master_init(TEST_SOCKET, flags);
        auth_master_set_timeout(auth_conn, 1000);
        list_ctx = auth_master_user_list_init(auth_conn, "*", &info);
-       while ((user = auth_master_user_list_next(list_ctx)) != NULL);
+       while (auth_master_user_list_next(list_ctx) != NULL);
        ret = auth_master_user_list_deinit(&list_ctx);
        auth_master_deinit(&auth_conn);
 
index bcb9d40f36c6d14aaca86699478f27dfccababc4..82760f202173498e203c33377beaecc0a0a4f96d 100644 (file)
@@ -319,7 +319,7 @@ fts_expunge_log_write(struct fts_expunge_log_append_ctx *ctx)
        /* the file was opened with O_APPEND, so this write() should be
           appended atomically without any need for locking. */
        for (;;) {
-               if ((ret = write_full(log->fd, buf->data, buf->used)) < 0) {
+               if (write_full(log->fd, buf->data, buf->used) < 0) {
                        i_error("write(%s) failed: %m", log->path);
                        if (ftruncate(log->fd, log->st.st_size) < 0)
                                i_error("ftruncate(%s) failed: %m", log->path);
index 78e66a2470a71db18926ad71c8af622932e33e70..409a9d69b4997bd4a8b57ad89f73e13741b879d0 100644 (file)
@@ -179,9 +179,9 @@ static int mcp_update_shared_keys(struct doveadm_mail_cmd_context *ctx,
        t_array_init(&ids, 8);
 
        /* figure out who needs the key */
-       if ((ret = mail_crypt_box_get_pvt_digests(box, pool_datastack_create(),
-                                                 MAIL_ATTRIBUTE_TYPE_SHARED,
-                                                 &ids, &error)) < 0) {
+       if (mail_crypt_box_get_pvt_digests(box, pool_datastack_create(),
+                                          MAIL_ATTRIBUTE_TYPE_SHARED,
+                                          &ids, &error) < 0) {
                i_error("mail_crypt_box_get_pvt_digests(%s, /shared) failed: %s",
                        mailbox_get_vname(box),
                        error);
@@ -272,8 +272,8 @@ static int mcp_keypair_generate(struct mcp_cmd_context *ctx,
                   FIXME: this could be less confusing altogether */
                ret = 0;
        } else {
-               if ((ret = mail_crypt_box_generate_keypair(box, &pair,
-                                               user_key, pubid_r, error_r)) < 0) {
+               if (mail_crypt_box_generate_keypair(box, &pair, user_key,
+                                                   pubid_r, error_r) < 0) {
                        ret = -1;
                } else {
                        *pubid_r = p_strdup(ctx->ctx.pool, *pubid_r);
@@ -490,7 +490,6 @@ static void mcp_key_list(struct mcp_cmd_context *ctx,
                        void *context)
 {
        const char *error;
-       int ret;
 
        /* we need to use the mailbox attribute API here, as we
           are not necessarily able to decrypt any of these keys
@@ -508,10 +507,9 @@ static void mcp_key_list(struct mcp_cmd_context *ctx,
                struct mail_attribute_value value;
                i_zero(&value);
 
-               if ((ret = mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED,
-                                                USER_CRYPT_PREFIX
-                                                ACTIVE_KEY_NAME,
-                                                &value)) < 0) {
+               if (mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED,
+                                         USER_CRYPT_PREFIX ACTIVE_KEY_NAME,
+                                         &value) < 0) {
                        i_error("mailbox_get_attribute(%s, %s) failed: %s",
                                mailbox_get_vname(box),
                                USER_CRYPT_PREFIX ACTIVE_KEY_NAME,
@@ -563,17 +561,16 @@ static void mcp_key_list(struct mcp_cmd_context *ctx,
                array_clear(&ids);
 
                /* get active ID */
-               if ((ret = mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED,
-                                                BOX_CRYPT_PREFIX
-                                                ACTIVE_KEY_NAME,
-                                                &value)) < 0) {
+               if (mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED,
+                                         BOX_CRYPT_PREFIX ACTIVE_KEY_NAME,
+                                         &value) < 0) {
                        i_error("mailbox_get_attribute(%s, %s) failed: %s",
                                mailbox_get_vname(box),
                                BOX_CRYPT_PREFIX ACTIVE_KEY_NAME,
                                mailbox_get_last_internal_error(box, NULL));
-               } else if ((ret = mail_crypt_box_get_pvt_digests(box, pool_datastack_create(),
-                                                                MAIL_ATTRIBUTE_TYPE_PRIVATE,
-                                                                &ids, &error)) < 0) {
+               } else if (mail_crypt_box_get_pvt_digests(box, pool_datastack_create(),
+                                                         MAIL_ATTRIBUTE_TYPE_PRIVATE,
+                                                         &ids, &error) < 0) {
                        i_error("mail_crypt_box_get_pvt_digests(%s) failed: %s",
                                mailbox_get_vname(box),
                                error);