]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fixed istream-attachment-extractor error handling.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 23 Aug 2016 10:40:50 +0000 (13:40 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 23 Aug 2016 10:40:50 +0000 (13:40 +0300)
src/lib-storage/index/index-attachment.c

index 4d0a5daae43d869f1ea1c926947227a588e2bef0..b77a034df040f7e46bbd3093dcd3ccd81a080f6d 100644 (file)
@@ -129,7 +129,7 @@ index_attachment_open_ostream(struct istream_attachment_info *info,
 
 static int
 index_attachment_close_ostream(struct ostream *output, bool success,
-                              const char **error_r, void *context)
+                              const char **error, void *context)
 {
        struct mail_save_context *ctx = context;
        struct mail_save_attachment *attach = ctx->data.attach;
@@ -138,13 +138,11 @@ index_attachment_close_ostream(struct ostream *output, bool success,
        i_assert(attach->cur_file != NULL);
 
        if (ret < 0)
-               fs_write_stream_abort_error(attach->cur_file, &output, "write(%s) failed: %s",
-                                           o_stream_get_name(output),
-                                           o_stream_get_error(output));
+               fs_write_stream_abort_error(attach->cur_file, &output, "%s", *error);
        else if (fs_write_stream_finish(attach->cur_file, &output) < 0) {
-               *error_r = t_strdup_printf("Couldn't create attachment %s: %s",
-                                          fs_file_path(attach->cur_file),
-                                          fs_file_last_error(attach->cur_file));
+               *error = t_strdup_printf("Couldn't create attachment %s: %s",
+                                        fs_file_path(attach->cur_file),
+                                        fs_file_last_error(attach->cur_file));
                ret = -1;
        }
        fs_file_deinit(&attach->cur_file);