You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/12 20:07:29 UTC

[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4123: nuttx: littlefs_close should return value bugfix

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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org