linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Fix memory leak if an error occurs when a data channel is reconnected.
@ 2011-03-25 17:39 Santiago Carot-Nemesio
  2011-03-25 17:39 ` [PATCH 2/2] Emit missing signal when " Santiago Carot-Nemesio
  2011-03-27 19:52 ` [PATCH 1/2] Fix memory leak if an error occurs when a " Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Santiago Carot-Nemesio @ 2011-03-25 17:39 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Santiago Carot-Nemesio

---
 health/hdp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/health/hdp.c b/health/hdp.c
index 3c2dce1..7a4b219 100644
--- a/health/hdp.c
+++ b/health/hdp.c
@@ -514,9 +514,9 @@ static void hdp_mdl_reconn_cb(struct mcap_mdl *mdl, GError *err, gpointer data)
 		reply = g_dbus_create_error(dc_data->msg,
 						ERROR_INTERFACE ".HealthError",
 						"Cannot get file descriptor");
-
-	reply = g_dbus_create_reply(dc_data->msg, DBUS_TYPE_UNIX_FD, &fd,
-							DBUS_TYPE_INVALID);
+	else
+		reply = g_dbus_create_reply(dc_data->msg, DBUS_TYPE_UNIX_FD,
+							&fd, DBUS_TYPE_INVALID);
 	g_dbus_send_message(dc_data->conn, reply);
 }
 
-- 
1.7.4.1


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

* [PATCH 2/2] Emit missing signal when data channel is reconnected.
  2011-03-25 17:39 [PATCH 1/2] Fix memory leak if an error occurs when a data channel is reconnected Santiago Carot-Nemesio
@ 2011-03-25 17:39 ` Santiago Carot-Nemesio
  2011-03-27 19:52 ` [PATCH 1/2] Fix memory leak if an error occurs when a " Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Santiago Carot-Nemesio @ 2011-03-25 17:39 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Santiago Carot-Nemesio

Reconnections of data channels should be indicated to others
applications by using the appropriate signal.
---
 health/hdp.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/health/hdp.c b/health/hdp.c
index 7a4b219..7fed483 100644
--- a/health/hdp.c
+++ b/health/hdp.c
@@ -510,14 +510,23 @@ static void hdp_mdl_reconn_cb(struct mcap_mdl *mdl, GError *err, gpointer data)
 	}
 
 	fd = mcap_mdl_get_fd(dc_data->hdp_chann->mdl);
-	if (fd < 0)
+	if (fd < 0) {
 		reply = g_dbus_create_error(dc_data->msg,
 						ERROR_INTERFACE ".HealthError",
 						"Cannot get file descriptor");
-	else
-		reply = g_dbus_create_reply(dc_data->msg, DBUS_TYPE_UNIX_FD,
+		g_dbus_send_message(dc_data->conn, reply);
+		return;
+	}
+
+	reply = g_dbus_create_reply(dc_data->msg, DBUS_TYPE_UNIX_FD,
 							&fd, DBUS_TYPE_INVALID);
 	g_dbus_send_message(dc_data->conn, reply);
+
+	g_dbus_emit_signal(dc_data->conn,
+			device_get_path(dc_data->hdp_chann->dev->dev),
+			HEALTH_DEVICE, "ChannelConnected",
+			DBUS_TYPE_OBJECT_PATH, &dc_data->hdp_chann->path,
+			DBUS_TYPE_INVALID);
 }
 
 static void hdp_get_dcpsm_cb(uint16_t dcpsm, gpointer user_data, GError *err)
-- 
1.7.4.1


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

* Re: [PATCH 1/2] Fix memory leak if an error occurs when a data channel is reconnected.
  2011-03-25 17:39 [PATCH 1/2] Fix memory leak if an error occurs when a data channel is reconnected Santiago Carot-Nemesio
  2011-03-25 17:39 ` [PATCH 2/2] Emit missing signal when " Santiago Carot-Nemesio
@ 2011-03-27 19:52 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2011-03-27 19:52 UTC (permalink / raw)
  To: Santiago Carot-Nemesio; +Cc: linux-bluetooth

Hi,

On Fri, Mar 25, 2011, Santiago Carot-Nemesio wrote:
> ---
>  health/hdp.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Both patches are now upstream. Thanks.

Johan

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

end of thread, other threads:[~2011-03-27 19:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-25 17:39 [PATCH 1/2] Fix memory leak if an error occurs when a data channel is reconnected Santiago Carot-Nemesio
2011-03-25 17:39 ` [PATCH 2/2] Emit missing signal when " Santiago Carot-Nemesio
2011-03-27 19:52 ` [PATCH 1/2] Fix memory leak if an error occurs when a " Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).