From c8ab3c2c984732d4f210b85c3f23139fef06da9d Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Sun, 24 Jun 2018 19:50:59 +0100 Subject: [PATCH] test-channel: Use socket compatibility layer Signed-off-by: Frediano Ziglio Acked-by: Victor Toso --- server/tests/test-channel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/tests/test-channel.c b/server/tests/test-channel.c index fcea98aa..372c8d79 100644 --- a/server/tests/test-channel.c +++ b/server/tests/test-channel.c @@ -183,7 +183,7 @@ static void send_ack_sync(int socket, uint32_t generation) msg.len = GUINT32_TO_LE(sizeof(generation)); msg.generation = GUINT32_TO_LE(generation); - g_assert_cmpint(write(socket, &msg.type, 10), ==, 10); + g_assert_cmpint(socket_write(socket, &msg.type, 10), ==, 10); } static SpiceTimer *waked_up_timer; @@ -198,7 +198,7 @@ static void timer_wakeup(void *opaque) ssize_t len; alarm(1); char buffer[256]; - while ((len=recv(client_socket, buffer, sizeof(buffer), 0)) > 0) + while ((len=socket_read(client_socket, buffer, sizeof(buffer))) > 0) got_data += len; alarm(0); @@ -218,7 +218,7 @@ static void timeout_watch_count(void *opaque) // get all pending data alarm(1); char buffer[256]; - while (recv(client_socket, buffer, sizeof(buffer), 0) > 0) + while (socket_read(client_socket, buffer, sizeof(buffer)) > 0) continue; alarm(0); @@ -226,7 +226,7 @@ static void timeout_watch_count(void *opaque) watch_called_countdown = 20; // send ack reply, this should unblock data from RedChannelClient - g_assert_cmpint(write(client_socket, "\2\0\0\0\0\0", 6), ==, 6); + g_assert_cmpint(socket_write(client_socket, "\2\0\0\0\0\0", 6), ==, 6); // expect data soon waked_up_timer = core->timer_add(timer_wakeup, core);