gustavonihei commented on a change in pull request #4123:
URL: https://github.com/apache/incubator-nuttx/pull/4123#discussion_r667879062
##########
File path: fs/littlefs/lfs_vfs.c
##########
@@ -335,7 +335,7 @@ static int littlefs_close(FAR struct file *filep)
if (--priv->refs <= 0)
{
- lfs_file_close(&fs->lfs, &priv->file);
+ ret = lfs_file_close(&fs->lfs, &priv->file);
Review comment:
Although this may not be critical, we need to convert the return value
from the `lfs_err_t` to standard `errno` value.
Most of the error codes from LittleFS map 1-to-1, except `LFS_ERR_CORRUPT`.
https://github.com/littlefs-project/littlefs/blob/master/lfs.h#L75
##########
File path: fs/littlefs/lfs_vfs.c
##########
@@ -335,7 +335,7 @@ static int littlefs_close(FAR struct file *filep)
if (--priv->refs <= 0)
{
- lfs_file_close(&fs->lfs, &priv->file);
+ ret = lfs_file_close(&fs->lfs, &priv->file);
Review comment:
Although this may not be critical, we need to convert the return value
from the `lfs_err_t` to standard `errno` value.
Most of the error codes from LittleFS map 1-to-1, except `LFS_ERR_CORRUPT`:
https://github.com/littlefs-project/littlefs/blob/master/lfs.h#L75
##########
File path: fs/littlefs/lfs_vfs.c
##########
@@ -335,7 +335,7 @@ static int littlefs_close(FAR struct file *filep)
if (--priv->refs <= 0)
{
- lfs_file_close(&fs->lfs, &priv->file);
+ ret = lfs_file_close(&fs->lfs, &priv->file);
Review comment:
Although this may not be critical, we need to convert the return value
from the `lfs_error` to standard `errno` value.
Most of the error codes from LittleFS map 1-to-1, except `LFS_ERR_CORRUPT`:
https://github.com/littlefs-project/littlefs/blob/master/lfs.h#L75
##########
File path: fs/littlefs/lfs_vfs.c
##########
@@ -335,7 +335,7 @@ static int littlefs_close(FAR struct file *filep)
if (--priv->refs <= 0)
{
- lfs_file_close(&fs->lfs, &priv->file);
+ ret = lfs_file_close(&fs->lfs, &priv->file);
Review comment:
Although this may not be critical, we need to convert the return value
from the `lfs_error` type to standard `errno` value.
Most of the error codes from LittleFS map 1-to-1, except `LFS_ERR_CORRUPT`:
https://github.com/littlefs-project/littlefs/blob/master/lfs.h#L75
##########
File path: fs/littlefs/lfs_vfs.c
##########
@@ -335,7 +335,7 @@ static int littlefs_close(FAR struct file *filep)
if (--priv->refs <= 0)
{
- lfs_file_close(&fs->lfs, &priv->file);
+ ret = lfs_file_close(&fs->lfs, &priv->file);
Review comment:
Ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]