Skip to content

Commit

Permalink
common-main.c: fflush stdout buffer when exit
Browse files Browse the repository at this point in the history
Signed-off-by: MinarKotonoha <[email protected]>
  • Loading branch information
chengzhuo5 committed Apr 8, 2024
1 parent ad0bbff commit 8bb3e09
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 8bb3e09

Please sign in to comment.