summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-12-23 22:27:19 -0700
committerJens Axboe <axboe@kernel.dk>2019-12-23 22:27:19 -0700
commit34fa10bd109c8665f4e94e018686b330ae3ddf6d (patch)
treee2e407dc7bfca640adef9bedc388fdb07a91e653
parent4332433754e872d54d612b35f329adfe5c70a969 (diff)
downloadliburing-34fa10bd109c8665f4e94e018686b330ae3ddf6d.tar.gz
liburing-34fa10bd109c8665f4e94e018686b330ae3ddf6d.tar.bz2
test/io-cancel: fix file mode and user data check
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/io-cancel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/io-cancel.c b/test/io-cancel.c
index edbfa80..da4fd62 100644
--- a/test/io-cancel.c
+++ b/test/io-cancel.c
@@ -120,7 +120,7 @@ static int wait_io(struct io_uring *ring, unsigned nr_io, int do_partial)
goto err;
}
if (do_partial && cqe->user_data) {
- if (!cqe->user_data & 1) {
+ if (!(cqe->user_data & 1)) {
if (cqe->res != BS) {
fprintf(stderr, "IO %d wasn't cancelled but got error %d\n", (unsigned) cqe->user_data, cqe->res);
goto err;
@@ -185,7 +185,7 @@ static int test_io_cancel(const char *file, int do_write, int do_partial)
unsigned to_wait;
int fd, ret;
- fd = open(file, O_RDONLY | O_DIRECT);
+ fd = open(file, O_RDWR | O_DIRECT);
if (fd < 0) {
perror("file open");
goto err;