[Spice-devel] [PATCH spice-server 12/33] event-loop: Use socket compatibility layer

Frediano Ziglio fziglio at redhat.com
Fri Dec 21 12:03:00 UTC 2018


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/event-loop.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/event-loop.c b/server/event-loop.c
index 413102e8..56200ce5 100644
--- a/server/event-loop.c
+++ b/server/event-loop.c
@@ -153,16 +153,16 @@ static void watch_update_mask(const SpiceCoreInterfaceInternal *iface,
 }
 
 static SpiceWatch *watch_add(const SpiceCoreInterfaceInternal *iface,
-                             int fd, int event_mask, SpiceWatchFunc func, void *opaque)
+                             socket_t fd, int event_mask, SpiceWatchFunc func, void *opaque)
 {
     SpiceWatch *watch;
 
-    spice_return_val_if_fail(fd != -1, NULL);
+    spice_return_val_if_fail(socket_is_valid(fd), NULL);
     spice_return_val_if_fail(func != NULL, NULL);
 
     watch = g_new0(SpiceWatch, 1);
     watch->context = iface->main_context;
-    watch->channel = g_io_channel_unix_new(fd);
+    watch->channel = g_io_channel_unix_new(socket_get_raw(fd));
     watch->func = func;
     watch->opaque = opaque;
 
-- 
2.17.2



More information about the Spice-devel mailing list