summaryrefslogtreecommitdiff
path: root/test/send_recvmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/send_recvmsg.c')
-rw-r--r--test/send_recvmsg.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/send_recvmsg.c b/test/send_recvmsg.c
index b208749..444d6a8 100644
--- a/test/send_recvmsg.c
+++ b/test/send_recvmsg.c
@@ -101,13 +101,24 @@ static void *recv_fn(void *data)
struct io_uring ring;
int ret;
- io_uring_queue_init(1, &ring, 0);
+ ret = io_uring_queue_init(1, &ring, 0);
+ if (ret) {
+ fprintf(stderr, "queue init failed: %d\n", ret);
+ goto err;
+ }
+
+ ret = recv_prep(&ring, &iov);
+ if (ret) {
+ fprintf(stderr, "recv_prep failed: %d\n", ret);
+ goto err;
+ }
- recv_prep(&ring, &iov);
pthread_mutex_unlock(mutex);
ret = do_recvmsg(&ring, &iov);
io_uring_queue_exit(&ring);
+
+err:
return (void *)(intptr_t)ret;
}
@@ -126,7 +137,7 @@ static int do_sendmsg(void)
ret = io_uring_queue_init(1, &ring, 0);
if (ret) {
- fprintf(stderr, "queue init fail: %d\n", ret);
+ fprintf(stderr, "queue init failed: %d\n", ret);
return 1;
}