This is an automated email from the ASF dual-hosted git repository.

ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit c5779297cf28f3e0d7d1d61597b1bfd29730138e
Author: Jiuzhu Dong <dongjiuz...@xiaomi.com>
AuthorDate: Mon Sep 6 20:24:17 2021 +0800

    littlefs/stat: return OK when stat success
    
    Signed-off-by: Jiuzhu Dong <dongjiuz...@xiaomi.com>
---
 fs/littlefs/lfs_vfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/littlefs/lfs_vfs.c b/fs/littlefs/lfs_vfs.c
index dfaf17440a..46c494ef49 100644
--- a/fs/littlefs/lfs_vfs.c
+++ b/fs/littlefs/lfs_vfs.c
@@ -1573,11 +1573,11 @@ static int littlefs_stat(FAR struct inode *mountpt, FAR 
const char *relpath,
           goto errout;
         }
 
-      ret = 0;
       memset(&attr, 0, sizeof(attr));
       attr.at_mode = S_IRWXG | S_IRWXU | S_IRWXO;
     }
 
+  ret = 0;
   buf->st_mode         = attr.at_mode;
   buf->st_uid          = attr.at_uid;
   buf->st_gid          = attr.at_gid;
@@ -1635,7 +1635,6 @@ static int littlefs_chstat(FAR struct inode *mountpt,
           goto errout;
         }
 
-      ret = 0;
       memset(&attr, 0, sizeof(attr));
     }
 

Reply via email to