From 5d6d052d8b28bdaf4fc0cba29234909727f46b6c Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 1 Oct 2018 21:03:34 +0100 Subject: [PATCH] Flush log file after asynchronous askappend. When I made the 'overwrite or append log file?' dialog box into a non-modal one, it exposed a bug in logging.c's handling of an asynchronous response to askappend(): we queued all the pending log data and wrote it out to the log file, but forgot the final fflush that would have made sure it all actually _went_ to the log file. So one stdio buffer's worth could still be held in the C library, to be released the next time log data shows up. Added the missing logflush(). --- logging.c | 1 + 1 file changed, 1 insertion(+) diff --git a/logging.c b/logging.c index da502c86..f07982ac 100644 --- a/logging.c +++ b/logging.c @@ -153,6 +153,7 @@ static void logfopen_callback(void *vctx, int mode) logwrite(ctx, data, len); bufchain_consume(&ctx->queue, len); } + logflush(ctx); } /*