summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/socket-rw-eagain.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/test/socket-rw-eagain.c b/test/socket-rw-eagain.c
index 9854e00..2d6a817 100644
--- a/test/socket-rw-eagain.c
+++ b/test/socket-rw-eagain.c
@@ -25,6 +25,7 @@ int main(int argc, char *argv[])
int32_t recv_s0;
int32_t val = 1;
struct sockaddr_in addr;
+ struct iovec iov_r[1], iov_w[1];
if (argc > 1)
return 0;
@@ -105,28 +106,24 @@ int main(int argc, char *argv[])
char send_buff[128];
{
- struct iovec iov[1];
-
- iov[0].iov_base = recv_buff;
- iov[0].iov_len = sizeof(recv_buff);
+ iov_r[0].iov_base = recv_buff;
+ iov_r[0].iov_len = sizeof(recv_buff);
struct io_uring_sqe* sqe = io_uring_get_sqe(&m_io_uring);
assert(sqe != NULL);
- io_uring_prep_readv(sqe, p_fd[0], iov, 1, 0);
+ io_uring_prep_readv(sqe, p_fd[0], iov_r, 1, 0);
sqe->user_data = 1;
}
{
- struct iovec iov[1];
-
- iov[0].iov_base = send_buff;
- iov[0].iov_len = sizeof(send_buff);
+ iov_w[0].iov_base = send_buff;
+ iov_w[0].iov_len = sizeof(send_buff);
struct io_uring_sqe* sqe = io_uring_get_sqe(&m_io_uring);
assert(sqe != NULL);
- io_uring_prep_writev(sqe, p_fd[1], iov, 1, 0);
+ io_uring_prep_writev(sqe, p_fd[1], iov_w, 1, 0);
sqe->user_data = 2;
}