]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/journal.c
journal: Don't immediately flush output events to disk
[empserver] / src / lib / subs / journal.c
index 93ae6635b9b7b10b1f1efde2518b0443d10a326f..f98d27311299539ebed75a2e18a4246acf5cea4f 100644 (file)
@@ -128,7 +128,8 @@ journal_entry_end(int newline, int flush)
     if (!newline)
        fputc('\\', journal);
     fputc('\n', journal);
     if (!newline)
        fputc('\\', journal);
     fputc('\n', journal);
-    fflush(journal);
+    if (flush)
+       fflush(journal);
     if (ferror(journal)) {
        logerror("Error writing journal (%s)", strerror(errno));
        clearerr(journal);
     if (ferror(journal)) {
        logerror("Error writing journal (%s)", strerror(errno));
        clearerr(journal);