xiaoxiang781216 commented on a change in pull request #2631:
URL: https://github.com/apache/incubator-nuttx/pull/2631#discussion_r551271645
##########
File path: fs/mqueue/mq_open.c
##########
@@ -196,19 +241,18 @@ int nxmq_open(FAR const char *mq_name, int oflags, mode_t
mode,
goto errout_with_inode;
}
- /* Create a message queue descriptor for the TCB */
+ /* Associate the inode with a file structure */
- *mqdes = nxmq_create_des(NULL, msgq, oflags);
- if (!*mqdes)
+ *mqdes = files_allocate(inode, oflags, 0, 0);
+ if (*mqdes < 0)
{
- ret = -ENOMEM;
+ ret = -EMFILE;
Review comment:
ret = *mqdes
##########
File path: fs/mqueue/mq_open.c
##########
@@ -147,14 +193,13 @@ int nxmq_open(FAR const char *mq_name, int oflags, mode_t
mode,
goto errout_with_inode;
}
- /* Create a message queue descriptor for the current thread */
+ /* Associate the inode with a file structure */
- msgq = inode->u.i_mqueue;
- *mqdes = nxmq_create_des(NULL, msgq, oflags);
- if (!*mqdes)
+ *mqdes = files_allocate(inode, oflags, 0, 0);
+ if (*mqdes < 0)
{
- ret = -ENOMEM;
- goto errout_with_inode;
+ ret = -EMFILE;
Review comment:
change to:
```
ret = *mqdes
```
see
https://github.com/apache/incubator-nuttx/pull/2639/files#diff-5adc55f87002f2d706285b3f201b7616f0055e9da6de5066f2f8bdcdab19d88fR63
##########
File path: fs/vfs/fs_unlink.c
##########
@@ -129,7 +129,12 @@ int nx_unlink(FAR const char *pathname)
* release all resources because it is no longer accessible.
*/
+#ifdef CONFIG_DISABLE_MQUEUE
if (INODE_IS_DRIVER(inode) && inode->u.i_ops->unlink)
+#else
+ if ((INODE_IS_DRIVER(inode) || INODE_IS_MQUEUE(inode))
+ && inode->u.i_ops->unlink)
Review comment:
don't need
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]