From 2d349bb70f5345887bd14973540ffa7528be2677 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 23 Aug 2016 13:40:50 +0300 Subject: [PATCH] lib-storage: Fixed istream-attachment-extractor error handling. --- src/lib-storage/index/index-attachment.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lib-storage/index/index-attachment.c b/src/lib-storage/index/index-attachment.c index 4d0a5daae4..b77a034df0 100644 --- a/src/lib-storage/index/index-attachment.c +++ b/src/lib-storage/index/index-attachment.c @@ -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);