diff options
| author | thegeorg <[email protected]> | 2023-07-26 17:26:21 +0300 |
|---|---|---|
| committer | thegeorg <[email protected]> | 2023-07-26 17:26:21 +0300 |
| commit | 3785d5f97965bccf048718d8717904cf50f9f8f9 (patch) | |
| tree | b7ce8ae67d7eb7fcf7767c54379f0564c281147f /contrib/libs/liburing/test/cq-overflow.c | |
| parent | 1f6b57071583f89299bb5abd3863d594f23c5be5 (diff) | |
Update contrib/libs/liburing to 2.4
Diffstat (limited to 'contrib/libs/liburing/test/cq-overflow.c')
| -rw-r--r-- | contrib/libs/liburing/test/cq-overflow.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/contrib/libs/liburing/test/cq-overflow.c b/contrib/libs/liburing/test/cq-overflow.c index f43e19c013f..569c7337527 100644 --- a/contrib/libs/liburing/test/cq-overflow.c +++ b/contrib/libs/liburing/test/cq-overflow.c @@ -49,7 +49,8 @@ static struct iovec *vecs; * bash -c "echo 1 > /proc/self/make-it-fail && exec ./cq-overflow.t" */ -static int test_io(const char *file, unsigned long usecs, unsigned *drops, int fault) +static int test_io(const char *file, unsigned long usecs, unsigned *drops, + int fault) { struct io_uring_sqe *sqe; struct io_uring_cqe *cqe; @@ -61,8 +62,10 @@ static int test_io(const char *file, unsigned long usecs, unsigned *drops, int f fd = open(file, O_RDONLY | O_DIRECT); if (fd < 0) { + if (errno == EINVAL) + return T_EXIT_SKIP; perror("file open"); - return 1; + return T_EXIT_FAIL; } memset(&p, 0, sizeof(p)); @@ -70,7 +73,7 @@ static int test_io(const char *file, unsigned long usecs, unsigned *drops, int f if (ret) { close(fd); fprintf(stderr, "ring create failed: %d\n", ret); - return 1; + return T_EXIT_FAIL; } nodrop = 0; if (p.features & IORING_FEAT_NODROP) @@ -174,12 +177,12 @@ reap_it: io_uring_queue_exit(&ring); close(fd); - return 0; + return T_EXIT_PASS; err: if (fd != -1) close(fd); io_uring_queue_exit(&ring); - return 1; + return T_EXIT_SKIP; } static int reap_events(struct io_uring *ring, unsigned nr_events, int do_wait) @@ -497,7 +500,10 @@ int main(int argc, char *argv[]) do { drops = 0; - if (test_io(fname, usecs, &drops, 0)) { + ret = test_io(fname, usecs, &drops, 0); + if (ret == T_EXIT_SKIP) + break; + else if (ret != T_EXIT_PASS) { fprintf(stderr, "test_io nofault failed\n"); goto err; } @@ -507,12 +513,12 @@ int main(int argc, char *argv[]) iters++; } while (iters < 40); - if (test_io(fname, usecs, &drops, 0)) { + if (test_io(fname, usecs, &drops, 0) == T_EXIT_FAIL) { fprintf(stderr, "test_io nofault failed\n"); goto err; } - if (test_io(fname, usecs, &drops, 1)) { + if (test_io(fname, usecs, &drops, 1) == T_EXIT_FAIL) { fprintf(stderr, "test_io fault failed\n"); goto err; } |
