Skip to content

Commit

Permalink
global: Replace o_stream_ignore_last_errors() with o_stream_abort() w…
Browse files Browse the repository at this point in the history
…herever possible
  • Loading branch information
sirainen committed Nov 15, 2017
1 parent 7660a51 commit 0a222de
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib-fs/fs-api.c
Expand Up @@ -770,7 +770,7 @@ static void fs_write_stream_abort(struct fs_file *file, struct ostream **output)
i_assert(output != &file->output);

*output = NULL;
o_stream_ignore_last_errors(file->output);
o_stream_abort(file->output);
/* make sure we don't have an old error lying around */
ret = fs_write_stream_finish_int(file, FALSE);
i_assert(ret != 0);
Expand Down
2 changes: 1 addition & 1 deletion src/lib-mail/test-istream-attachment.c
Expand Up @@ -194,7 +194,7 @@ test_close_attachment_ostream_error(struct ostream *output,
{
if (success)
*error = "test output error";
o_stream_ignore_last_errors(output);
o_stream_abort(output);
o_stream_destroy(&output);
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib-storage/index/dbox-common/dbox-file-fix.c
Expand Up @@ -466,7 +466,7 @@ int dbox_file_fix(struct dbox_file *file, uoff_t start_offset)
o_stream_cork(output);
ret = dbox_file_fix_write_stream(file, start_offset, temp_path, output);
if (ret < 0)
o_stream_ignore_last_errors(output);
o_stream_abort(output);
have_messages = output->offset > file->file_header_size;
o_stream_unref(&output);
if (close(fd) < 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib-storage/index/dbox-common/dbox-file.c
Expand Up @@ -534,7 +534,7 @@ void dbox_file_append_rollback(struct dbox_file_append_context **_ctx)
dbox_file_set_syscall_error(file, "ftruncate()");
}
if (ctx->output != NULL) {
o_stream_ignore_last_errors(ctx->output);
o_stream_abort(ctx->output);
o_stream_unref(&ctx->output);
}
i_free(ctx);
Expand Down
2 changes: 1 addition & 1 deletion src/lib-storage/list/subscription-file.c
Expand Up @@ -242,7 +242,7 @@ int subsfile_set_subscribed(struct mailbox_list *list, const char *path,
}
}
} else {
o_stream_ignore_last_errors(output);
o_stream_abort(output);
}
o_stream_destroy(&output);

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/fts-squat/squat-uidlist.c
Expand Up @@ -1074,13 +1074,14 @@ int squat_uidlist_rebuild_finish(struct squat_uidlist_rebuild_context *ctx,
ret = -1;
}
ctx->build_ctx->need_reopen = TRUE;
} else {
o_stream_abort(ctx->output);
}

/* we no longer require the entire uidlist to be in memory,
let it be used for something more useful. */
squat_uidlist_free_from_memory(ctx->uidlist);

o_stream_ignore_last_errors(ctx->output);
o_stream_unref(&ctx->output);
if (close(ctx->fd) < 0)
i_error("close(%s) failed: %m", temp_path);
Expand Down

0 comments on commit 0a222de

Please sign in to comment.