dovecot-1.2: mbox: Write the last LF before fdatasync().
dovecot at dovecot.org
dovecot at dovecot.org
Fri Oct 16 22:30:22 EEST 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/b5e6de777e52
changeset: 9443:b5e6de777e52
user: Timo Sirainen <tss at iki.fi>
date: Fri Oct 16 15:30:15 2009 -0400
description:
mbox: Write the last LF before fdatasync().
diffstat:
1 file changed, 4 insertions(+)
src/lib-storage/index/mbox/mbox-save.c | 4 ++++
diffs (14 lines):
diff -r 562af4a76438 -r b5e6de777e52 src/lib-storage/index/mbox/mbox-save.c
--- a/src/lib-storage/index/mbox/mbox-save.c Fri Oct 16 15:19:54 2009 -0400
+++ b/src/lib-storage/index/mbox/mbox-save.c Fri Oct 16 15:30:15 2009 -0400
@@ -770,6 +770,10 @@ int mbox_transaction_save_commit(struct
mbox_set_syscall_error(mbox, "utime()");
}
+ if (ctx->output != NULL) {
+ /* flush the final LF */
+ o_stream_flush(ctx->output);
+ }
if (mbox->mbox_fd != -1 && !mbox->mbox_writeonly &&
!mbox->ibox.fsync_disable) {
if (fdatasync(mbox->mbox_fd) < 0) {
More information about the dovecot-cvs
mailing list