summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-02-24 11:35:31 -0700
committerJens Axboe <axboe@kernel.dk>2020-02-24 11:35:31 -0700
commit02c7cac133ca48134455cb87564432f912d5788b (patch)
tree2532c45ce1be61c312b6210e01c7507e21d13f8a /test
parentfaff5be2ccd554fa22edb00ada19da4ce721a20e (diff)
downloadliburing-02c7cac133ca48134455cb87564432f912d5788b.tar.gz
liburing-02c7cac133ca48134455cb87564432f912d5788b.tar.bz2
test/splice: fix-up test case on kernels not supporting splice
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'test')
-rw-r--r--test/splice.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/splice.c b/test/splice.c
index cdaaf2f..8a7878b 100644
--- a/test/splice.c
+++ b/test/splice.c
@@ -39,7 +39,13 @@ static int copy_single(struct io_uring *ring,
len, flags2);
ret = io_uring_submit(ring);
- if (ret < 1) {
+ if (ret < 2) {
+ /* submitted just one, kernel likely doesn't support splice */
+ if (!io_uring_peek_cqe(ring, &cqe) &&
+ cqe->res == -EINVAL) {
+ no_splice = 1;
+ return -1;
+ }
fprintf(stderr, "sqe submit failed: %d\n", ret);
return -1;
}