Skip to content

fs: Fix fstat retarget for regular files #5203

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

Merged
merged 1 commit into from
Oct 5, 2017

Conversation

geky
Copy link
Contributor

@geky geky commented Sep 26, 2017

GCC's newlib library depends on fstat to get in-flight information about a file's type an size. A working fstat for regular files is needed for seek and related functions to work correctly.

Side note about testing this and #5183, I have tests inbound, which is what's finding these bugs. They're currently targeting littlefs here, but I will also bring them over the FAT filesystem once they're up and running.

GCC's newlib library depends on fstat to get in-flight information about
a file's type an size. A working fstat for regular files is needed for
seek and related functions to work correctly.
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 27, 2017

cc @kjbracey-arm

return -1;
}

st->st_mode = S_IFREG;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also indicate S_IFCHR if FileHandle::isatty()?

Copy link
Contributor Author

@geky geky Sep 27, 2017

Choose a reason for hiding this comment

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

Good point, should be updated

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 29, 2017

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1439

Test failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 2, 2017

/morph test-nightly

@mbed-bot
Copy link

mbed-bot commented Oct 3, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1496

Test failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 4, 2017

The latest failure was not caused by this patch, master had to be patched, should be all good now

/morph test-nightly

@mbed-bot
Copy link

mbed-bot commented Oct 4, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1519

All builds and test passed!

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

Successfully merging this pull request may close these issues.

5 participants