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

Added synchronization with the main storage device before direct recording #3668

Closed
wants to merge 2 commits into from

Conversation

Roman-Koshelev
Copy link
Contributor

@Roman-Koshelev Roman-Koshelev commented Oct 3, 2023

Added reset of caching stream buffers before direct writing to the descriptor

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

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

Thanks for the PR but please revert unrelated formatting changes and add more context. I applied clang-format separately.

@Roman-Koshelev
Copy link
Contributor Author

Done.

#endif
return false;
if (!c_file) return false;
os.flush();
Copy link
Contributor

Choose a reason for hiding this comment

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

We should only flush the buffer when writing to a console. I suggest moving the ostream change to a separate PR and addressing this issue. The rest LGTM.

@vitaut
Copy link
Contributor

vitaut commented Oct 24, 2023

Merged without the ostream part in 3b7f58a. Thanks.

@vitaut vitaut closed this Oct 24, 2023
if (!_isatty(fd)) return false;
std::fflush(f);
Copy link
Contributor

@dimztimz dimztimz Oct 25, 2023

Choose a reason for hiding this comment

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

Adding fflush here is not correct. This function write_console() is called either from the C stream print() or the C++ iostream print(). In the latter case, fflush should not be called at all, instead the ostream flush should be invoked.

Copy link
Contributor

Choose a reason for hiding this comment

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

This flush is indeed redundant for iostream but in the future please report issues like these once to avoid too much notification noise.

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.

None yet

3 participants