summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorzhkag <[email protected]>2023-09-08 18:15:03 +0800
committerGitHub <[email protected]>2023-09-08 18:15:03 +0800
commit0b9a808ccacfd900c3cfc3a69cce7688b3bcaeb8 (patch)
tree4b2a6a28f79d69f54ba058c4f151a025ca28ee4b /components
parentdfc8994ea2aa3fb4c13e59fcbf005983fc6fe03e (diff)
[posix]修复消息队列返回长度异常 (#8014)
Diffstat (limited to 'components')
-rw-r--r--components/libc/posix/ipc/mqueue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/libc/posix/ipc/mqueue.c b/components/libc/posix/ipc/mqueue.c
index 45a1382313..a452092875 100644
--- a/components/libc/posix/ipc/mqueue.c
+++ b/components/libc/posix/ipc/mqueue.c
@@ -130,7 +130,7 @@ ssize_t mq_receive(mqd_t id, char *msg_ptr, size_t msg_len, unsigned *msg_prio)
result = rt_mq_recv_prio(mq, msg_ptr, msg_len, (rt_int32_t *)msg_prio, RT_WAITING_FOREVER, RT_UNINTERRUPTIBLE);
if (result >= 0)
- return rt_strlen(msg_ptr);
+ return result;
rt_set_errno(EBADF);
return -1;
@@ -186,7 +186,7 @@ ssize_t mq_timedreceive(mqd_t id,
result = rt_mq_recv_prio(mq, msg_ptr, msg_len, (rt_int32_t *)msg_prio, tick, RT_UNINTERRUPTIBLE);
if (result >= 0)
- return rt_strlen(msg_ptr);
+ return result;
if (result == -RT_ETIMEOUT)
rt_set_errno(ETIMEDOUT);