]> 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:48:22 +0000 (13:48 +0300)
src/lib-storage/index/index-attachment.c

index 51c2982c32674b44bdba1ce0d9778193668ac3ab..6735c4fba79a0b35e281827e1a98eda74f86e8ae 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);