aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHao Xu <howeyxu@tencent.com>2022-06-17 22:36:02 +0800
committerJens Axboe <axboe@kernel.dk>2022-06-17 08:41:45 -0600
commitd0d9b70d4861bae77b86c05f6925e991cb6c32f1 (patch)
tree9ce4d6098859b2a4d52e03b8ff769fcec3fc7fb4
parentc8909b9e1963f4651927f8f46d1d0420d28bcd58 (diff)
downloadliburing-d0d9b70d4861bae77b86c05f6925e991cb6c32f1.tar.gz
test/accept: fix minus one error when calculating multishot_mask
We don't need to minus one for the s_fd[i] since the returned cqe.res is already the fixed file table slot which is indexed from zero. Fixes: 66cf84527c34 ("test/accept.c: add test for multishot mode accept") Signed-off-by: Hao Xu <howeyxu@tencent.com> Link: https://lore.kernel.org/r/20220617143603.179277-3-hao.xu@linux.dev Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/accept.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/accept.c b/test/accept.c
index fb87a1d..368bc90 100644
--- a/test/accept.c
+++ b/test/accept.c
@@ -241,7 +241,7 @@ static int test_loop(struct io_uring *ring,
i, s_fd[i]);
goto err;
}
- multishot_mask |= (1 << (s_fd[i] - 1));
+ multishot_mask |= (1U << s_fd[i]);
}
if (!multishot)
break;