From 92a253c88fed533117ed91e2bfe9ccb5da7a2c1f Mon Sep 17 00:00:00 2001 From: DylanLiuH2O <44540113+DylanLiuH2O@users.noreply.github.com> Date: Sun, 14 May 2023 11:15:36 +0800 Subject: [PATCH] [components][libc][posix] fix RT_NAME_MAX misspelled as NAME_MAX (#7489) --- components/libc/posix/ipc/mqueue.c | 6 +++--- 1 file 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)