[Spice-devel] [PATCH spice-server v6 09/19] red-stream: Use socket compatibility layer

Frediano Ziglio fziglio at redhat.com
Tue Apr 30 12:24:09 UTC 2019


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/red-stream.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/server/red-stream.c b/server/red-stream.c
index 323af58c..af7036e5 100644
--- a/server/red-stream.c
+++ b/server/red-stream.c
@@ -112,7 +112,7 @@ static int socket_set_cork(int socket, int enabled)
 
 static ssize_t stream_write_cb(RedStream *s, const void *buf, size_t size)
 {
-    return write(s->socket, buf, size);
+    return socket_write(s->socket, buf, size);
 }
 
 static ssize_t stream_writev_cb(RedStream *s, const struct iovec *iov, int iovcnt)
@@ -130,7 +130,7 @@ static ssize_t stream_writev_cb(RedStream *s, const struct iovec *iov, int iovcn
         for (i = 0; i < tosend; i++) {
             expected += iov[i].iov_len;
         }
-        n = writev(s->socket, iov, tosend);
+        n = socket_writev(s->socket, iov, tosend);
         if (n <= expected) {
             if (n > 0)
                 ret += n;
@@ -146,7 +146,7 @@ static ssize_t stream_writev_cb(RedStream *s, const struct iovec *iov, int iovcn
 
 static ssize_t stream_read_cb(RedStream *s, void *buf, size_t size)
 {
-    return read(s->socket, buf, size);
+    return socket_read(s->socket, buf, size);
 }
 
 static ssize_t stream_ssl_write_cb(RedStream *s, const void *buf, size_t size)
@@ -402,7 +402,7 @@ void red_stream_free(RedStream *s)
     }
 
     red_stream_remove_watch(s);
-    close(s->socket);
+    socket_close(s->socket);
 
     g_free(s);
 }
-- 
2.20.1



More information about the Spice-devel mailing list