Skip to content

Commit

Permalink
lib-storage: Fixed istream-attachment-extractor error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Aug 23, 2016
1 parent d3aecee commit 2d349bb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/lib-storage/index/index-attachment.c
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 2d349bb

Please sign in to comment.