GUIDINGLI commented on a change in pull request #2631:
URL: https://github.com/apache/incubator-nuttx/pull/2631#discussion_r551013560



##########
File path: fs/mqueue/mq_open.c
##########
@@ -266,31 +402,26 @@ int nxmq_open(FAR const char *mq_name, int oflags, mode_t 
mode,
 
 mqd_t mq_open(FAR const char *mq_name, int oflags, ...)
 {
-  FAR struct mq_attr *attr = NULL;
-  mode_t mode = 0;
+  struct file mq;
   mqd_t mqdes;
   va_list ap;
   int ret;
 
-  /* Were we asked to create it? */
-
-  if ((oflags & O_CREAT) != 0)
+  va_start(ap, oflags);
+  ret = file_mq_vopen(&mq, mq_name, oflags, ap);
+  va_end(ap);
+  if (ret < 0)
     {
-      /* We have to extract the additional
-       * parameters from the variable argument list.
-       */
-
-      va_start(ap, oflags);
-      mode = va_arg(ap, mode_t);
-      attr = va_arg(ap, FAR struct mq_attr *);
-      va_end(ap);
+      set_errno(-ret);
+      return ERROR;
     }
 
-  ret = nxmq_open(mq_name, oflags, mode, attr, &mqdes);
-  if (ret < 0)
+  mqdes = files_allocate(mq.f_inode, mq.f_oflags, 0, 0);

Review comment:
       f_pos ?
   done




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


Reply via email to