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

fs: Fix fstat retarget for regular files #5203

Merged
merged 1 commit into from Oct 5, 2017

Conversation

Projects
None yet
5 participants
@geky
Member

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.

@geky geky added the needs: review label Sep 26, 2017

fs: Fixed fstat retarget for regular files
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

This comment has been minimized.

Member

0xc0170 commented Sep 27, 2017

platform/mbed_retarget.cpp Outdated
return -1;
}
st->st_mode = S_IFREG;

This comment has been minimized.

@kjbracey-arm

kjbracey-arm Sep 27, 2017

Contributor

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

This comment has been minimized.

@geky

geky Sep 27, 2017

Member

Good point, should be updated

@geky geky force-pushed the geky:fix-fstat-newlib branch to 0132691 Sep 27, 2017

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Sep 28, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 29, 2017

/morph test-nightly

@mbed-bot

This comment has been minimized.

mbed-bot commented Sep 29, 2017

Result: FAILURE

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

/morph test-nightly

Output

mbed Build Number: 1439

Test failed!

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 2, 2017

/morph test-nightly

@mbed-bot

This comment has been minimized.

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

This comment has been minimized.

Member

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

This comment has been minimized.

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!

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Oct 4, 2017

@theotherjimmy theotherjimmy merged commit da138f2 into ARMmbed:master Oct 5, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-test-nightly Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment