]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mbox: Write the last LF before fdatasync().
authorTimo Sirainen <tss@iki.fi>
Fri, 16 Oct 2009 19:30:29 +0000 (15:30 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 16 Oct 2009 19:30:29 +0000 (15:30 -0400)
--HG--
branch : HEAD

src/lib-storage/index/mbox/mbox-save.c

index 77755ac62adc6670ba230857c44f681edcefa2ab..3f6cb7560ed41204a30a4d98a0095d52069c7c2b 100644 (file)
@@ -775,6 +775,10 @@ int mbox_transaction_save_commit_pre(struct mail_save_context *_ctx)
                        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->storage->storage.set->fsync_disable) {
                if (fdatasync(mbox->mbox_fd) < 0) {