Re: [PATCH spice-gtk 5/9] session: connect to UNIX path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 13, 2015 at 05:38:24PM +0100, Marc-André Lureau wrote:
> ---
>  gtk/spice-session.c | 43 ++++++++++++++++++++++++++++---------------
>  1 file changed, 28 insertions(+), 15 deletions(-)
> 
> diff --git a/gtk/spice-session.c b/gtk/spice-session.c
> index 83d8568..6f04a1a 100644
> --- a/gtk/spice-session.c
> +++ b/gtk/spice-session.c
> @@ -19,7 +19,9 @@
>  
>  #include <gio/gio.h>
>  #include <glib.h>
> -
> +#ifdef G_OS_UNIX
> +#include <gio/gunixsocketaddress.h>
> +#endif
>  #include "common/ring.h"
>  
>  #include "spice-client.h"
> @@ -1972,21 +1974,25 @@ static gboolean open_host_idle_cb(gpointer data)
>          return FALSE;
>      }
>  
> -    if (open_host->proxy)
> +    if (open_host->proxy) {
>          g_resolver_lookup_by_name_async(g_resolver_get_default(),
>                                          spice_uri_get_hostname(open_host->proxy),
>                                          open_host->cancellable,
>                                          proxy_lookup_ready, open_host);
> -    else
> -    {
> +    } else {
>          GSocketConnectable *address;
>  
> -        address = g_network_address_new(s->host, open_host->port);
> +        if (s->unix_path) {
> +            SPICE_DEBUG("open path %s", s->unix_path);

slight preference for the more verbose "open unix path" here

> +            address = G_SOCKET_CONNECTABLE(g_unix_socket_address_new(s->unix_path));

You need to protect this with G_OS_UNIX too.

Looks good otherwise.

Christophe

Attachment: pgpX9cg87pTBw.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]