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/13 03:59:53 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4121: vfs: stat_recursive should return -ENOSYS if stat callback is NULL

xiaoxiang781216 commented on a change in pull request #4121:
URL: https://github.com/apache/incubator-nuttx/pull/4121#discussion_r668408982



##########
File path: fs/vfs/fs_stat.c
##########
@@ -120,6 +120,10 @@ static int stat_recursive(FAR const char *path,
 
           ret = inode->u.i_mops->stat(inode, desc.relpath, buf);
         }
+      else
+        {
+          ret = -ENOSYS;

Review comment:
       If the file system doesn't provide stat implementation, it is wrong to return OK but with the bad/unitial value in the stat buf. How to interpret the error code not mention in standard? I think the error code is the implementation detail, OS can return other suitable error code, unless the standared specially note the error case and code(e.g. EAGAIN, EINTR...).




-- 
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