]> git.pond.sub.org Git - empserver/commitdiff
journal: Don't immediately flush output events to disk
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 22 Jan 2021 06:17:36 +0000 (07:17 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 6 Feb 2021 15:55:37 +0000 (16:55 +0100)
Commit 478566258 'New journal event "output"' (v4.3.27) claims "Output
events are *not* flushed to disk immediately."  They are.  Accident.
Implement the missing bit.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
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);
-    fflush(journal);
+    if (flush)
+       fflush(journal);
     if (ferror(journal)) {
        logerror("Error writing journal (%s)", strerror(errno));
        clearerr(journal);