From f14ea735832776eb7a28fe9e210bb270d401060e Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 30 Jul 2010 19:49:03 +0200 Subject: [PATCH] Flush the journal after every write. Unexpected bugs in the parser, engine or in procedures can cause crashes in the GUI. If the journal is not flushed *before* running the syntax, then no record of that syntax exists, and the bug can be hard to reproduce. This change ensures that the syntax is written to the journal before it is processed. --- src/output/journal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/output/journal.c b/src/output/journal.c index 1a700898ac..10da4d8485 100644 --- a/src/output/journal.c +++ b/src/output/journal.c @@ -98,6 +98,11 @@ journal_output (struct journal_driver *j, const char *s) } fprintf (j->file, "%s\n", s); + + /* Flush the journal in case the syntax we're about to write + causes a crash. Having the syntax already written to disk + makes postmortem analysis of the problem possible. */ + fflush (j->file); } static void -- 2.30.2