summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-09-21 14:26:42 -0600
committerJens Axboe <axboe@kernel.dk>2019-09-21 14:27:33 -0600
commit5652c3bcda738c16ab4e6f12e637559cc379a4e7 (patch)
treed6fb20f5c10c51b99f5159ca6bdcde31918af914
parent7485e31f855d8646e6c59cd048f6803a4137e1f7 (diff)
downloadliburing-5652c3bcda738c16ab4e6f12e637559cc379a4e7.tar.gz
liburing-5652c3bcda738c16ab4e6f12e637559cc379a4e7.tar.bz2
io_uring_wait_cqe_timeout: fix wrong error return check
Fixes: 76e9232baa00 ("Add io_uring_wait_cqe_timeout()") Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/queue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/queue.c b/src/queue.c
index 4bb9d6f..32e9857 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -79,14 +79,14 @@ int io_uring_wait_cqe_timeout(struct io_uring *ring,
sqe = io_uring_get_sqe(ring);
if (!sqe) {
ret = io_uring_submit(ring);
- if (ret)
+ if (ret < 0)
return ret;
sqe = io_uring_get_sqe(ring);
}
io_uring_prep_timeout(sqe, ts, 1);
sqe->user_data = LIBURING_UDATA_TIMEOUT;
ret = io_uring_submit(ring);
- if (ret)
+ if (ret < 0)
return ret;
return __io_uring_get_cqe(ring, cqe_ptr, 1, 1);