[Spice-devel] [PATCH spice-server v5 09/18] red-stream: Use socket compatibility layer
Frediano Ziglio
fziglio at redhat.com
Fri Mar 29 09:00:05 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 4fb2d2bf6..ab3d87c7c 100644
--- a/server/red-stream.c
+++ b/server/red-stream.c
@@ -114,7 +114,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)
@@ -132,7 +132,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;
@@ -148,7 +148,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)
@@ -404,7 +404,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