mirror of
https://github.com/openharmony/third_party_liburing.git
synced 2026-07-21 07:05:34 -04:00
examples/io_uring-cp: handle io_uring_peek_cqe() -EAGAIN
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -168,8 +168,13 @@ static int copy_file(struct io_uring *ring, off_t insize)
|
||||
if (!got_comp) {
|
||||
ret = io_uring_wait_cqe(ring, &cqe);
|
||||
got_comp = 1;
|
||||
} else
|
||||
} else {
|
||||
ret = io_uring_peek_cqe(ring, &cqe);
|
||||
if (ret == -EAGAIN) {
|
||||
cqe = NULL;
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "io_uring_peek_cqe: %s\n",
|
||||
strerror(-ret));
|
||||
|
||||
Reference in New Issue
Block a user