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

Fix fd_fdstat_set_flags truncating with O_TRUNC #1863

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

yagehu
Copy link
Contributor

@yagehu yagehu commented Dec 12, 2023

This commit fixes a buf when fd_fdstat_set_flags would erroneously truncate an open file if it is opened with the O_TRUNC flag. This happens because the O_TRUNC flag causes the file to be truncated when it is opened.

This fixes #1862

This commit fixes a buf when `fd_fdstat_set_flags` would erroneously
truncate an open file if it is opened with the O_TRUNC flag.  This
happens because the O_TRUNC flag causes the file to be truncated when it
is opened.

Signed-off-by: Yage Hu <me@huyage.dev>
Copy link
Contributor

@evacchi evacchi left a comment

Choose a reason for hiding this comment

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

I think this looks good, thanks for your contribution!

@mathetake mathetake merged commit 99ededc into tetratelabs:main Dec 12, 2023
53 checks passed
@yagehu yagehu deleted the yagehu/false-trunc branch December 12, 2023 18:10
gaukas pushed a commit to refraction-networking/wazero that referenced this pull request Dec 14, 2023
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.

fd_fdstat_set_flags truncates file
4 participants