diff mbox series

[2/3] test/accept: fix minus one error when calculating multishot_mask

Message ID 20220617143603.179277-3-hao.xu@linux.dev (mailing list archive)
State New
Headers show
Series multishot accept test fix and clean | expand

Commit Message

Hao Xu June 17, 2022, 2:36 p.m. UTC
From: Hao Xu <howeyxu@tencent.com>

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>
---
 test/accept.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/test/accept.c b/test/accept.c
index c6654baa3925..b322c018c7a9 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;