]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm mail batch: Fix run() return value on errors
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 29 Sep 2021 16:04:37 +0000 (18:04 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 29 Sep 2021 16:24:53 +0000 (16:24 +0000)
The function always returned 0, even when there was an error. This practically
doesn't fix anything, but makes it work the way it was intended. It also makes
scan-build happier.

Broken by fd4360e30b695e596a5081a6080152188a12852a

src/doveadm/doveadm-mail-batch.c

index 5acacc91637dc588dc7e6ed43ad3fc04304bb6cd..2dbbb891bb21181d6931692f5a4b046280684505 100644 (file)
@@ -42,12 +42,11 @@ static int cmd_batch_run(struct doveadm_mail_cmd_context *_ctx,
                        event_reason_code_prefix("doveadm", "cmd_",
                                                 cmd->cmd->name);
                struct event_reason *reason = event_reason_begin(reason_code);
-               int ret = cmd->v.run(cmd, user);
+               ret = cmd->v.run(cmd, user);
                event_reason_end(&reason);
                if (ret < 0) {
                        i_assert(cmd->exit_code != 0);
                        _ctx->exit_code = cmd->exit_code;
-                       ret = -1;
                        break;
                }
                cmd->cur_mail_user = NULL;