summaryrefslogtreecommitdiff
path: root/test/send_recv.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/send_recv.c')
-rw-r--r--test/send_recv.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/test/send_recv.c b/test/send_recv.c
index 85f77e8..19adbdd 100644
--- a/test/send_recv.c
+++ b/test/send_recv.c
@@ -13,6 +13,7 @@
#include <pthread.h>
#include "liburing.h"
+#include "helpers.h"
static char str[] = "This is a test of send and recv over io_uring!";
@@ -138,15 +139,13 @@ static void *recv_fn(void *data)
if (rd->use_sqthread)
p.flags = IORING_SETUP_SQPOLL;
- ret = io_uring_queue_init_params(1, &ring, &p);
- if (ret) {
- if (rd->use_sqthread && geteuid()) {
- fprintf(stdout, "Skipping SQPOLL variant\n");
- pthread_mutex_unlock(&rd->mutex);
- ret = 0;
- goto err;
- }
- fprintf(stderr, "queue init failed: %d\n", ret);
+ ret = t_create_ring_params(1, &ring, &p);
+ if (ret == T_SETUP_SKIP) {
+ pthread_mutex_unlock(&rd->mutex);
+ ret = 0;
+ goto err;
+ } else if (ret < 0) {
+ pthread_mutex_unlock(&rd->mutex);
goto err;
}