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
@@ -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);
}
