-
Notifications
You must be signed in to change notification settings - Fork 266
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
wasi: resets offsets in reopen #1866
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you can see, unfortunately this is failing on Windows
f8af47b
to
4ad7124
Compare
Fixed! |
This commit fixes `fd_fdstat_set_flags` resetting the fd offset due to it reopening the file every time. This fix gets the current offset before reopening and restore the offset with seek. Signed-off-by: Yage Hu <[email protected]>
thanks! |
4ad7124
to
7478b88
Compare
I see you force-pushed new changes, let me know when the PR is in a stable state @yagehu ! :) |
I'm done. Just a quick fix to avoid double |
fd_fdstat_set_flags
resetting offset} | ||
|
||
if !isDir { | ||
offset, err = f.file.Seek(0, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe too late for a nit, but please constants for the whence: io.SeekStart
, etc…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, let's fix it in a follow up PR
Signed-off-by: Yage Hu <[email protected]>
This commit fixes
fd_fdstat_set_flags
resetting the fd offset due to it reopening the file every time. This fix gets the current offset before reopening and restore the offset with seek. This addresses #1865.NB: A couple of existing tests are actually spec'd wrong. To fix, I introduced addition
Seek
calls before checking removing append flag.