This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push: new bb8b5493e testing: ostest: Show errno in message queue test bb8b5493e is described below commit bb8b5493e08206ae4959546c66cc0e0c2c5500c3 Author: Masayuki Ishikawa <masayuki.ishik...@gmail.com> AuthorDate: Tue Jan 31 18:10:59 2023 +0900 testing: ostest: Show errno in message queue test Summary: - This commit shows errno in message queue test Impact: - None Testing: - Tested with esp32-devkitc:smp on QEMU-7.1 Signed-off-by: Masayuki Ishikawa <masayuki.ishik...@jp.sony.com> --- testing/ostest/mqueue.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/testing/ostest/mqueue.c b/testing/ostest/mqueue.c index 1b4b3191c..fadbb0223 100644 --- a/testing/ostest/mqueue.c +++ b/testing/ostest/mqueue.c @@ -97,7 +97,7 @@ static void *sender_thread(void *arg) g_send_mqfd = mq_open("mqueue", O_WRONLY | O_CREAT, 0666, &attr); if (g_send_mqfd == (mqd_t)-1) { - printf("sender_thread: ERROR mq_open failed\n"); + printf("sender_thread: ERROR mq_open failed, errno=%d\n", errno); ASSERT(false); pthread_exit((pthread_addr_t)1); } @@ -113,8 +113,9 @@ static void *sender_thread(void *arg) status = mq_send(g_send_mqfd, msg_buffer, TEST_MSGLEN, 42); if (status < 0) { - printf("sender_thread: ERROR mq_send failure=%d on msg %d\n", - status, i); + printf("sender_thread: ERROR mq_send failure=%d on msg %d, " + "errno=%d\n", + status, i, errno); ASSERT(false); nerrors++; } @@ -128,7 +129,7 @@ static void *sender_thread(void *arg) if (mq_close(g_send_mqfd) < 0) { - printf("sender_thread: ERROR mq_close failed\n"); + printf("sender_thread: ERROR mq_close failed, errno=%d\n", errno); ASSERT(false); } else @@ -170,7 +171,7 @@ static void *receiver_thread(void *arg) g_recv_mqfd = mq_open("mqueue", O_RDONLY | O_CREAT, 0666, &attr); if (g_recv_mqfd == (mqd_t)-1) { - printf("receiver_thread: ERROR mq_open failed\n"); + printf("receiver_thread: ERROR mq_open failed, errno=%d\n", errno); ASSERT(false); pthread_exit((pthread_addr_t)1); }