if (file->copy_input != NULL) {
i_stream_unref(&file->copy_input);
- fs_write_stream_abort(file, &file->copy_output);
+ fs_write_stream_abort_error(file, &file->copy_output, "fs_file_close(%s)",
+ o_stream_get_name(file->copy_output));
}
i_free_and_null(file->write_digest);
if (file->fs->v.file_close != NULL) T_BEGIN {
va_end(args);
}
-void fs_write_stream_abort(struct fs_file *file, struct ostream **output)
-{
- fs_write_stream_abort_error(file, output, "Write aborted");
-}
-
void fs_write_set_hash(struct fs_file *file, const struct hash_method *method,
const void *digest)
{
doesn't need to do it. This must not be called after
fs_write_stream_finish(), i.e. it can't be used to abort a pending async
write. */
-void fs_write_stream_abort(struct fs_file *file, struct ostream **output);
void fs_write_stream_abort_error(struct fs_file *file, struct ostream **output, const char *error_fmt, ...) ATTR_FORMAT(3, 4);
/* Set a hash to the following write. The storage can then verify that the
i_stream_is_eof(file->hash_input)) {
o_stream_unref(&_file->output);
if (fs_sis_try_link(file)) {
- fs_write_stream_abort(_file->parent, &file->fs_output);
+ fs_write_stream_abort_error(_file->parent, &file->fs_output,
+ "fs_sis_try_link(%s) failed",
+ o_stream_get_name(file->fs_output));
return 1;
}
}
test_assert(test_file->contents->used == 0);
break;
case 2:
- fs_write_stream_abort(file, &output);
+ fs_write_stream_abort_error(file, &output, "test");
test_assert(test_file->contents->used == 0);
break;
}