summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorDylanLiuH2O <[email protected]>2023-05-14 11:15:36 +0800
committerGitHub <[email protected]>2023-05-14 11:15:36 +0800
commit92a253c88fed533117ed91e2bfe9ccb5da7a2c1f (patch)
tree5ecec805bc8f1d4316bf78e7e3fd1fd03a80a4b9 /components
parentebf4c0f24e7c8366d6d986808c36d208752190fe (diff)
[components][libc][posix] fix RT_NAME_MAX misspelled as NAME_MAX (#7489)
Diffstat (limited to 'components')
-rw-r--r--components/libc/posix/ipc/mqueue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/libc/posix/ipc/mqueue.c b/components/libc/posix/ipc/mqueue.c
index 684891731e..6f04945962 100644
--- a/components/libc/posix/ipc/mqueue.c
+++ b/components/libc/posix/ipc/mqueue.c
@@ -138,7 +138,7 @@ mqd_t mq_open(const char *name, int oflag, ...)
/* lock posix mqueue list */
rt_sem_take(&posix_mq_lock, RT_WAITING_FOREVER);
int len = rt_strlen(name);
- if (len > PATH_MAX || len > NAME_MAX)
+ if (len > PATH_MAX || len > RT_NAME_MAX)
{
rt_set_errno(ENAMETOOLONG);
goto __return;
@@ -159,9 +159,9 @@ mqd_t mq_open(const char *name, int oflag, ...)
{
va_start(arg, oflag);
mode = (mode_t)va_arg(arg, unsigned int);
- mode = mode;
+ mode = (mode_t)mode; /* self-assignment avoids compiler optimization */
attr = (struct mq_attr *)va_arg(arg, struct mq_attr *);
- attr = attr;
+ attr = (struct mq_attr *)attr; /* self-assignment avoids compiler optimization */
va_end(arg);
if (attr->mq_maxmsg <= 0)