[Spice-devel] [PATCH spice-server v4 14/20] test-channel: Use socket compatibility layer

Frediano Ziglio fziglio at redhat.com
Wed Feb 6 13:58:50 UTC 2019


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 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 ec0fdceb..a634a662 100644
--- a/server/tests/test-channel.c
+++ b/server/tests/test-channel.c
@@ -194,7 +194,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;
@@ -209,7 +209,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);
 
@@ -229,7 +229,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);
 
@@ -237,7 +237,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);
-- 
2.20.1



More information about the Spice-devel mailing list