Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common-main.c: fflush stdout buffer when exit #4901

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

chengzhuo5
Copy link

No description provided.

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great finding, and obviously-good fix!

You may want to follow the advice in https://github.blog/2022-06-30-write-better-commits-build-better-projects/ to align the commit message's style with Git's conventions.

common-main.c Outdated Show resolved Hide resolved
common-main.c Outdated Show resolved Hide resolved
@chengzhuo5 chengzhuo5 requested a review from dscho April 9, 2024 02:03
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>
@dscho dscho added this to the Next release milestone Apr 12, 2024
@dscho dscho merged commit 79cd17f into git-for-windows:main Apr 12, 2024
41 checks passed
github-actions bot pushed a commit to git-for-windows/build-extra that referenced this pull request Apr 12, 2024
Apparently some anti-malware programs fiddle with the mode of `stdout`
which [can lead to problems because expected output is
missing](git-for-windows/git#4890), which [was
fixed](git-for-windows/git#4901).

Signed-off-by: gitforwindowshelper[bot] <gitforwindowshelper-bot@users.noreply.github.com>
@dscho
Copy link
Member

dscho commented Apr 12, 2024

Thank you @chengzhuo5 for going the extra mile to fix the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants