summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-01-26 15:45:46 -0700
committerJens Axboe <axboe@kernel.dk>2021-01-26 15:54:07 -0700
commit25ca5d25ef974c40fe367f983d16b58296e5065d (patch)
tree35948efd652d09a5dfdc3fdc2fd6fead5d2bafbb
parent00c2056c3fa05383539bae1a9b4a136fda90db52 (diff)
downloadliburing-25ca5d25ef974c40fe367f983d16b58296e5065d.tar.gz
liburing-25ca5d25ef974c40fe367f983d16b58296e5065d.tar.bz2
test/file-register: cleanups
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/file-register.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/file-register.c b/test/file-register.c
index effa021..0f4d679 100644
--- a/test/file-register.c
+++ b/test/file-register.c
@@ -562,16 +562,15 @@ static int test_skip(struct io_uring *ring)
goto err;
}
- /* -2 to skip */
- files[90] = -2;
+ files[90] = IORING_REGISTER_FILES_SKIP;
ret = io_uring_register_files_update(ring, 90, &files[90], 1);
if (ret != 1) {
fprintf(stderr, "%s: update ret=%d\n", __FUNCTION__, ret);
goto err;
}
- /* verify can still use file index 90 */
- if (test_fixed_read_write(ring, 90))
+ /* verify can still use file index 90 */
+ if (test_fixed_read_write(ring, 90))
goto err;
ret = io_uring_unregister_files(ring);
@@ -587,7 +586,6 @@ err:
return 1;
}
-
static int test_sparse_updates(void)
{
struct io_uring ring;
@@ -816,7 +814,7 @@ int main(int argc, char *argv[])
return ret;
}
- ret = test_skip(&ring);
+ ret = test_skip(&ring);
if (ret) {
printf("test_skip failed\n");
return 1;
@@ -836,4 +834,3 @@ int main(int argc, char *argv[])
return 0;
}
-