When we build liburing without libc, we can't check `errno` variable with respect to liburing's functions. Don't do that it in test. Note: The tests themselves can still use `errno` to check error from functions that come from the libc, but not liburing. Link: https://github.com/axboe/liburing/issues/443 Fixes: https://github.com/axboe/liburing/issues/449 Signed-off-by: Ammar Faizi <ammar.faizi@xxxxxxxxxxxxxxxxxxxxx> --- test/cq-size.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/cq-size.c b/test/cq-size.c index b7dd5b4..4e6e3d1 100644 --- a/test/cq-size.c +++ b/test/cq-size.c @@ -45,14 +45,20 @@ int main(int argc, char *argv[]) p.cq_entries = 0; ret = io_uring_queue_init_params(4, &ring, &p); - if (ret >= 0 || errno != EINVAL) { + if (ret >= 0) { printf("zero sized cq ring succeeded\n"); + io_uring_queue_exit(&ring); + goto err; + } + + if (ret != -EINVAL) { + printf("io_uring_queue_init_params failed, but not with -EINVAL" + ", returned error %d (%s)\n", ret, strerror(-ret)); goto err; } done: return 0; err: - io_uring_queue_exit(&ring); return 1; } -- 2.30.2