]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Take mail_save_context parameter in save_check_write_error()
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Mon, 27 Nov 2017 12:09:21 +0000 (14:09 +0200)
committerMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Mon, 11 Dec 2017 07:41:54 +0000 (09:41 +0200)
This is in order to use mail_set_critical() in the function later.

src/lib-storage/index/index-attachment.c

index 6b403ed6d901d5675c4b0b7f9eaefa9cc6b1dfb0..2ed6da8af6857bb51472d5384a8c4d3e2d274e93 100644 (file)
@@ -190,9 +190,11 @@ void index_attachment_save_begin(struct mail_save_context *ctx,
        ctx->data.attach = attach;
 }
 
-static int save_check_write_error(struct mail_storage *storage,
+static int save_check_write_error(struct mail_save_context *ctx,
                                  struct ostream *output)
 {
+       struct mail_storage *storage = ctx->transaction->box->storage;
+
        if (output->stream_errno == 0)
                return 0;
 
@@ -235,7 +237,7 @@ int index_attachment_save_continue(struct mail_save_context *ctx)
                return -1;
        }
        if (ctx->data.output != NULL) {
-               if (save_check_write_error(storage, ctx->data.output) < 0)
+               if (save_check_write_error(ctx, ctx->data.output) < 0)
                        return -1;
        }
        return 0;