test/send_recvmsg: cleanup on abort
If we don't have PROVIDE_BUFFERS, then ensure we free the ring, and
(more importantly) up the mutex so we don't hang.
@@ -162,7 +162,7 @@ static void *recv_fn(void *data)
io_uring_cqe_seen(&ring, cqe);
if (ret == -EINVAL) {
fprintf(stdout, "PROVIDE_BUFFERS not supported, skip\n");
- ret = 0;
+ goto out;
goto err;
} else if (ret < 0) {
fprintf(stderr, "PROVIDER_BUFFERS %d\n", ret);
@@ -183,6 +183,10 @@ static void *recv_fn(void *data)
err:
return (void *)(intptr_t)ret;
+out:
+ pthread_mutex_unlock(mutex);
+ io_uring_queue_exit(&ring);
+ return NULL;
}
static int do_sendmsg(void)
@@ -296,6 +300,5 @@ int main(int argc, char *argv[])
return 1;
}
-
return 0;
}
