mirror of
https://github.com/git-for-windows/git.git
synced 2026-05-31 12:28:51 -05:00
common-main.c: fflush stdout buffer upon exit
By default, the buffer type of Windows' `stdout` is unbuffered (_IONBF), and there is no need to manually fflush `stdout`. But some programs, such as the Windows Filtering Platform driver provided by the security software, may change the buffer type of `stdout` to full buffering. This nees `fflush(stdout)` to be called manually, otherwise there will be no output to `stdout`. Signed-off-by: MinarKotonoha <chengzhuo5@qq.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
committed by
Johannes Schindelin
parent
c214f36db2
commit
dbd4e4a01d
@@ -77,6 +77,13 @@ static void check_bug_if_BUG(void)
|
|||||||
/* We wrap exit() to call common_exit() in git-compat-util.h */
|
/* We wrap exit() to call common_exit() in git-compat-util.h */
|
||||||
int common_exit(const char *file, int line, int code)
|
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"
|
* 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
|
* to e.g. turn -1 into 255. On a POSIX system this is
|
||||||
|
|||||||
Reference in New Issue
Block a user