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


##########
fs/vfs/fs_dup.c:
##########
@@ -65,29 +65,32 @@ int file_dup(FAR struct file *filep, int minfd, int flags)
   uint8_t f_tag_fdcheck; /* File owner fdcheck tag, init to 0 */
 #endif
 
-  fd2 = file_allocate(g_root_inode, 0, 0, NULL, minfd, true);
+  /* Pass the close on exec flag to file_allocate */
+
+  fd2 = file_allocate(g_root_inode, flags, 0, NULL, minfd, true);
   if (fd2 < 0)
     {
       return fd2;
     }
 
   ret = fs_getfilep(fd2, &filep2);
 #ifdef CONFIG_FDSAN
-  f_tag_fdsan = filep2->f_tag_fdsan;
+  f_tag_fdsan = nx_fcntl(fd2, NX_GETTAG_FDSAN, 0);

Review Comment:
   let's recheck the code



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to