From 17e1a799f4193513ce58ef1c82a1bc11c657078c Mon Sep 17 00:00:00 2001 From: MinarKotonoha Date: Mon, 8 Apr 2024 15:45:37 +0800 Subject: [PATCH] common-main.c: fflush stdout buffer when exit --- common-main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common-main.c b/common-main.c index 033778b3c56a35..4b73e3760a27ff 100644 --- a/common-main.c +++ b/common-main.c @@ -86,5 +86,10 @@ int common_exit(const char *file, int line, int code) check_bug_if_BUG(); trace2_cmd_exit_fl(file, line, code); + /** + * Some software (such as security software) may change buffer type of stdout. + * It will no output without fflush manually. + */ + fflush(stdout); return code; }