changeset 9443:b5e6de777e52 HEAD

mbox: Write the last LF before fdatasync().
author Timo Sirainen <tss@iki.fi>
date Fri, 16 Oct 2009 15:30:15 -0400
parents 562af4a76438
children a5d8d201bd39
files src/lib-storage/index/mbox/mbox-save.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 			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) {