From 8b3a49c61af07f033a77afd425f438b9bb76dfa0 Mon Sep 17 00:00:00 2001 From: oreo639 Date: Sun, 23 Mar 2025 17:20:26 -0700 Subject: [PATCH] task.c: fflush before fork to avoid duplicated output buffers (fix: #67) --- src/task.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/task.c b/src/task.c index c619512..5691876 100644 --- a/src/task.c +++ b/src/task.c @@ -300,6 +300,9 @@ recode_perform_task (RECODE_TASK task) subtask->output.cursor = subtask->output.buffer; #if HAVE_PIPE + /* Flush all outputs to avoid duplicated buffers after calling fork */ + fflush (NULL); + /* Create all subprocesses, from the first to the last, and interconnect them. */