Skip to content

Commit

Permalink
common-main.c: fflush stdout buffer when exit (#4901)
Browse files Browse the repository at this point in the history
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Apr 16, 2024
2 parents 9bcb244 + 4049700 commit 6f7d49a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions common-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ static void check_bug_if_BUG(void)
/* We wrap exit() to call common_exit() in git-compat-util.h */
int common_exit(const char *file, int line, int code)
{
/*
* Windows Filtering Platform driver provided by the security software
* may change buffer type of stdout from _IONBF to _IOFBF.
* It will no output without fflush manually.
*/
fflush(stdout);

/*
* For non-POSIX systems: Take the lowest 8 bits of the "code"
* to e.g. turn -1 into 255. On a POSIX system this is
Expand Down

0 comments on commit 6f7d49a

Please sign in to comment.