xiaoxiang781216 commented on code in PR #21613:
URL: https://github.com/apache/nuttx/pull/21613#discussion_r4523010883


##########
fs/rpmsgfs/rpmsgfs_server.c:
##########
@@ -390,6 +390,19 @@ static int rpmsgfs_open_handler(FAR struct rpmsg_endpoint 
*ept,
     }
 
   ret = file_open(filep, msg->pathname, msg->flags, msg->mode);
+  if (ret >= 0 && (msg->flags & O_ACCMODE) == O_RDONLY)
+    {
+      struct stat buf;
+
+      /* A directory: the client opens it with the directory messages */
+
+      if (file_fstat(filep, &buf) >= 0 && S_ISDIR(buf.st_mode))

Review Comment:
   could we check in the server side to avoid the additional call?



##########
fs/hostfs/hostfs.c:
##########
@@ -277,6 +277,20 @@ static int hostfs_open(FAR struct file *filep, FAR const 
char *relpath,
       goto errout_with_buffer;
     }
 
+  /* A directory: file_vopen() opens it with the directory operations */
+
+  if ((oflags & O_ACCMODE) == O_RDONLY)
+    {
+      struct stat buf;
+
+      ret = host_fstat(hf->fd, &buf);

Review Comment:
   could we check in the server side to avoid the additional call?



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

Reply via email to