From 4d67af399dee3319d10cfd3db29d440383c37d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 20 Jan 2020 21:15:15 +0100 Subject: [PATCH] core: flush stdout/stderr before forking in hook_process function (closes #1441) --- ChangeLog.adoc | 1 + src/core/hook/wee-hook-process.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 990d39383..13c51795a 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -28,6 +28,7 @@ New features:: Bug fixes:: + * core: flush stdout/stderr before forking in hook_process function (issue #1441) * core: fix evaluation of condition with nested "if" (issue #1434) * irc: case-insensitive comparison on incoming CTCP command, force upper case on CTCP replies (issue #1439) * irc: fix memory leak when the channel topic is changed diff --git a/src/core/hook/wee-hook-process.c b/src/core/hook/wee-hook-process.c index be9060b96..d17a8867c 100644 --- a/src/core/hook/wee-hook-process.c +++ b/src/core/hook/wee-hook-process.c @@ -655,6 +655,10 @@ hook_process_run (struct t_hook *hook_process) HOOK_PROCESS(hook_process, child_write[i]) = pipes[i][1]; } + /* flush stdout and stderr before forking */ + fflush (stdout); + fflush (stderr); + /* fork */ switch (pid = fork ()) {