ctx->output = o_stream_create_fd_file(mbox->mbox_fd,
ctx->append_offset,
FALSE);
+ o_stream_cork(ctx->output);
}
return 0;
}
if (ctx->failed && ctx->mail_offset != (uoff_t)-1) {
/* saving this mail failed - truncate back to beginning of it */
+ (void)o_stream_flush(ctx->output);
if (ftruncate(ctx->mbox->mbox_fd, (off_t)ctx->mail_offset) < 0)
mbox_set_syscall_error(ctx->mbox, "ftruncate()");
+ o_stream_seek(ctx->output, ctx->mail_offset);
ctx->mail_offset = (uoff_t)-1;
}