All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] gdbus: properly init client connected state
@ 2018-02-06  8:51 Matt Schulte
  2018-02-06  8:59 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Schulte @ 2018-02-06  8:51 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Matt Schulte

GDBusClient struct's connected member was being initialize to false for
all new clients even if the connection was connected. This changes the
GDBusClient connected field to be initialized from the state of the dbus
connection
---
 gdbus/client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdbus/client.c b/gdbus/client.c
index eaab7d50b..a41ce1a7f 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -1316,7 +1316,7 @@ GDBusClient *g_dbus_client_new_full(DBusConnection *connection,
 	client->service_name = g_strdup(service);
 	client->base_path = g_strdup(path);
 	client->root_path = g_strdup(root_path);
-	client->connected = FALSE;
+	client->connected = dbus_connection_get_is_connected(connection);
 
 	client->match_rules = g_ptr_array_sized_new(1);
 	g_ptr_array_set_free_func(client->match_rules, g_free);
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH BlueZ] gdbus: properly init client connected state
  2018-02-06  8:51 [PATCH BlueZ] gdbus: properly init client connected state Matt Schulte
@ 2018-02-06  8:59 ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2018-02-06  8:59 UTC (permalink / raw)
  To: Matt Schulte; +Cc: linux-bluetooth

Hi Matt,

On Tue, Feb 6, 2018 at 6:51 AM, Matt Schulte <schultetwin1@gmail.com> wrote:
> GDBusClient struct's connected member was being initialize to false for
> all new clients even if the connection was connected. This changes the
> GDBusClient connected field to be initialized from the state of the dbus
> connection
> ---
>  gdbus/client.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gdbus/client.c b/gdbus/client.c
> index eaab7d50b..a41ce1a7f 100644
> --- a/gdbus/client.c
> +++ b/gdbus/client.c
> @@ -1316,7 +1316,7 @@ GDBusClient *g_dbus_client_new_full(DBusConnection *connection,
>         client->service_name = g_strdup(service);
>         client->base_path = g_strdup(path);
>         client->root_path = g_strdup(root_path);
> -       client->connected = FALSE;
> +       client->connected = dbus_connection_get_is_connected(connection);

This is actually to track if the client service name is available on
the bus, not the local connection passed as parameter which shall
always be connected, if the service has not been acquired yet it will
wait until it appears.

>         client->match_rules = g_ptr_array_sized_new(1);
>         g_ptr_array_set_free_func(client->match_rules, g_free);
> --
> 2.16.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-06  8:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-06  8:51 [PATCH BlueZ] gdbus: properly init client connected state Matt Schulte
2018-02-06  8:59 ` Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.