From a15a5b19a4bc85f2485dbedbdfcea39b22805aed Mon Sep 17 00:00:00 2001 From: zhkag Date: Fri, 6 Jan 2023 02:07:06 +0000 Subject: 修复 mq_timedreceive 中 mq_timedreceive 为空时断言 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/posix/ipc/mqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components/libc') diff --git a/components/libc/posix/ipc/mqueue.c b/components/libc/posix/ipc/mqueue.c index ae50582160..c764036455 100644 --- a/components/libc/posix/ipc/mqueue.c +++ b/components/libc/posix/ipc/mqueue.c @@ -254,8 +254,8 @@ ssize_t mq_timedreceive(mqd_t mqdes, return -1; } - - tick = rt_timespec_to_tick(abs_timeout); + if (abs_timeout != RT_NULL) + tick = rt_timespec_to_tick(abs_timeout); result = rt_mq_recv(mqdes->mq, msg_ptr, msg_len, tick); if (result == RT_EOK) -- cgit v1.3.1