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

Make sure to flush when using print. #2640

Merged
merged 2 commits into from
Nov 21, 2024
Merged

Conversation

floitsch
Copy link
Member

No description provided.

@floitsch floitsch requested a review from kasperl November 21, 2024 15:35
Copy link
Member

@kasperl kasperl left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@@ -122,6 +122,9 @@ static Object* write_on_std(const uint8* bytes, size_t length, bool is_stdout, b
}
}

FILE* stream = is_stdout ? stdout : stderr;
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure we need this here? I don't like the mixing of win32 and std APIs here. Not sure if FlushFileBuffers would work.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed it.
I read in some places that FlushFileBuffers wouldn't do anything on stdout/stderr.

@floitsch floitsch enabled auto-merge (squash) November 21, 2024 16:24
@floitsch floitsch merged commit 93b092a into master Nov 21, 2024
26 checks passed
@floitsch floitsch deleted the floitsch/flush-write-on-std branch November 21, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants