summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2011-03-14 18:19:42 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2011-03-15 10:52:56 +0200
commit6cb460ab9cefde24db960d53dde7410eac72e010 (patch)
tree42428d7f4397bee9b1696f47d8440a8517a28dec
parent17c03b0de4650d52b9de218ea95b817ad346c375 (diff)
downloadbluez-6cb460ab9cefde24db960d53dde7410eac72e010.tar.gz
Fix not returning an error when DiscoverCharacteristics() fails
When the connection fails an error should be returned to inform the user. This adds a field to store the DBusMessage that caused the error, so we can send the correct reply.
-rw-r--r--attrib/client.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/attrib/client.c b/attrib/client.c
index 14fd9110d..aa22a7976 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -59,6 +59,7 @@ struct gatt_service {
char *path;
GSList *primary;
GAttrib *attrib;
+ DBusMessage *msg;
int psm;
gboolean listen;
};
@@ -335,6 +336,12 @@ static void connect_cb(GIOChannel *chan, GError *gerr, gpointer user_data)
struct gatt_service *gatt = user_data;
if (gerr) {
+ if (gatt->msg) {
+ DBusMessage *reply = btd_error_failed(gatt->msg,
+ gerr->message);
+ g_dbus_send_message(connection, reply);
+ }
+
error("%s", gerr->message);
goto fail;
}