diff options
author | Jens Axboe <axboe@kernel.dk> | 2022-03-04 16:35:18 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-03-08 06:02:46 -0700 |
commit | 7887833a0d59939f513b74b58a5efb8e94a39342 (patch) | |
tree | bc6de3431df3a13845979e94ded321ee749005bc | |
parent | bbcc0e06b47a2aab828e57e67cd3d592293097fb (diff) | |
download | liburing-registered-ring.tar.gz liburing-registered-ring.tar.bz2 |
test/sq-poll-dup: modify ring fd hack to work with enter_ring_fdregistered-ring
No application should be directly modifying the ring_fd, it's done just
to test some internals. Make sure it works with the split of ring_fd
and enter_ring_fd.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | test/sq-poll-dup.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/sq-poll-dup.c b/test/sq-poll-dup.c index 9596866..0076a31 100644 --- a/test/sq-poll-dup.c +++ b/test/sq-poll-dup.c @@ -10,7 +10,6 @@ #include <string.h> #include <fcntl.h> #include <sys/types.h> -#include <poll.h> #include <sys/eventfd.h> #include <sys/resource.h> @@ -29,9 +28,14 @@ static struct io_uring rings[NR_RINGS]; static int wait_io(struct io_uring *ring, int nr_ios) { struct io_uring_cqe *cqe; + int ret; while (nr_ios) { - io_uring_wait_cqe(ring, &cqe); + ret = io_uring_wait_cqe(ring, &cqe); + if (ret) { + fprintf(stderr, "wait_ret=%d\n", ret); + return 1; + } if (cqe->res != BS) { fprintf(stderr, "Unexpected ret %d\n", cqe->res); return 1; @@ -123,7 +127,7 @@ static int test(int fd, int do_dup_and_close, int close_ring) ring_fd = dup(rings[0].ring_fd); if (close_ring) close(rings[0].ring_fd); - rings[0].ring_fd = ring_fd; + rings[0].ring_fd = rings[0].enter_ring_fd = ring_fd; if (do_dup_and_close) goto done; |