[Spice-devel] [PATCH spice-server 22/33] event-loop: Port to Windows

Marc-André Lureau marcandre.lureau at gmail.com
Sat Dec 22 10:18:21 UTC 2018


On Fri, Dec 21, 2018 at 4:04 PM Frediano Ziglio <fziglio at redhat.com> wrote:
>
> Use g_io_channel_win32_new_socket instead of g_io_channel_unix_new
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau at redhat.com>


> ---
>  server/event-loop.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/server/event-loop.c b/server/event-loop.c
> index 56200ce5..72af9ab9 100644
> --- a/server/event-loop.c
> +++ b/server/event-loop.c
> @@ -123,6 +123,7 @@ static gboolean watch_func(GIOChannel *source, GIOCondition condition,
>                             gpointer data)
>  {
>      SpiceWatch *watch = data;
> +    // this works also under Windows despite the name
>      int fd = g_io_channel_unix_get_fd(source);
>
>      watch->func(fd, giocondition_to_spice_event(condition), watch->opaque);
> @@ -162,7 +163,11 @@ static SpiceWatch *watch_add(const SpiceCoreInterfaceInternal *iface,
>
>      watch = g_new0(SpiceWatch, 1);
>      watch->context = iface->main_context;
> +#ifndef _WIN32
>      watch->channel = g_io_channel_unix_new(socket_get_raw(fd));
> +#else
> +    watch->channel = g_io_channel_win32_new_socket(socket_get_raw(fd));
> +#endif
>      watch->func = func;
>      watch->opaque = opaque;
>
> --
> 2.17.2
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel



--
Marc-André Lureau


More information about the Spice-devel mailing list