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 propagation of error code in LITTLEFS_read()/LITTLEFS_write() #26

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

fwolter
Copy link

@fwolter fwolter commented May 5, 2022

The comparison if (*bw < 0) in LITTLEFS_write(..) will always yield false, because *bw is an unsigned pointer. Same for the read function.
This yields to SYS_FS_FileError(..) returning a no-error state when LITTLEFS_read()/LITTLEFS_write() have been failed.

This also fixes the missing mapping from the LittleFS error code to the Harmony error code in LITTLEFS_read().

fwolter added 7 commits May 5, 2022 10:55
The bytes-written argument must be signed, otherwise the check "if (*bw < 0)" will always yield false and the error code isn't available with SYS_FS_FileError(..).
@fwolter fwolter changed the title Fix propagation of error code in LITTLEFS_write() Fix propagation of error code in LITTLEFS_read()/LITTLEFS_write() May 5, 2022
@vishalnxt
Copy link
Collaborator

@fwolter , thank you for reporting the issue and suggesting the fix as well. This will be fixed in the next release of core.

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

Successfully merging this pull request may close these issues.

2 participants