summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-04-16 14:29:35 -0600
committerJens Axboe <axboe@kernel.dk>2022-04-16 14:29:35 -0600
commit6a504852c2c5fa8af18e54263515ab5723cad2c9 (patch)
tree859e5ef5bdc166e004c8f81df4d3af9c2d8a4408
parent67b1d7ad568cec6cc4216fc55513cd17bf66e950 (diff)
downloadliburing-6a504852c2c5fa8af18e54263515ab5723cad2c9.tar.gz
liburing-6a504852c2c5fa8af18e54263515ab5723cad2c9.tar.bz2
test/poll-cancel-all: abort test if cancel flags not supported
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/poll-cancel-all.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/poll-cancel-all.c b/test/poll-cancel-all.c
index f16ffaa..754ec4f 100644
--- a/test/poll-cancel-all.c
+++ b/test/poll-cancel-all.c
@@ -12,6 +12,8 @@
#include "liburing.h"
+static int no_cancel_flags;
+
static int test1(struct io_uring *ring, int *fd)
{
struct io_uring_sqe *sqe;
@@ -59,6 +61,8 @@ static int test1(struct io_uring *ring, int *fd)
}
for (i = 0; i < 9; i++) {
+ if (no_cancel_flags)
+ break;
ret = io_uring_wait_cqe(ring, &cqe);
if (ret) {
fprintf(stderr, "wait=%d\n", ret);
@@ -66,6 +70,10 @@ static int test1(struct io_uring *ring, int *fd)
}
switch (cqe->user_data) {
case 100:
+ if (cqe->res == -EINVAL) {
+ no_cancel_flags = 1;
+ break;
+ }
if (cqe->res != 8) {
fprintf(stderr, "canceled %d\n", cqe->res);
return 1;
@@ -263,10 +271,12 @@ int main(int argc, char *argv[])
fprintf(stderr, "test1 failed\n");
return ret;
}
+ if (no_cancel_flags)
+ return 0;
ret = test2(&ring, fd);
if (ret) {
- fprintf(stderr, "test1 failed\n");
+ fprintf(stderr, "test2 failed\n");
return ret;
}