summaryrefslogtreecommitdiffstats
path: root/input/manager.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-05-27 18:05:38 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-05-27 18:05:38 +0000
commitee47f9f75ecc4ea8756f9b301905ec7de5ac07a3 (patch)
treed3b2cd1783ad7824b79751ada94a625f68bae74c /input/manager.c
parent80d6914d167a731d97aff4e25497f84e96e09fe3 (diff)
Use message sending helpers
Diffstat (limited to 'input/manager.c')
-rw-r--r--input/manager.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/input/manager.c b/input/manager.c
index c5e075cc..b65ccb16 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -218,7 +218,6 @@ static void interrupt_connect_cb(GIOChannel *chan, int err,
{
struct pending_req *pr = user_data;
struct hidp_connadd_req hidp;
- DBusMessage *reply;
const char *path;
memset(&hidp, 0, sizeof(hidp));
@@ -252,16 +251,11 @@ static void interrupt_connect_cb(GIOChannel *chan, int err,
device_paths = g_slist_append(device_paths, g_strdup(path));
- /* Replying to the requestor */
- reply = dbus_message_new_method_return(pr->msg);
-
- dbus_message_append_args(reply,
- DBUS_TYPE_STRING, &path,
- DBUS_TYPE_INVALID);
-
- send_message_and_unref(pr->conn, reply);
+ g_dbus_send_reply(pr->conn, pr->msg, DBUS_TYPE_STRING, &path,
+ DBUS_TYPE_INVALID);
goto cleanup;
+
failed:
error_connection_attempt_failed(pr->conn, pr->msg, err);
@@ -447,7 +441,6 @@ fail:
static void headset_record_cb(sdp_list_t *recs, int err, gpointer user_data)
{
struct pending_req *pr = user_data;
- DBusMessage *reply;
sdp_record_t *rec;
sdp_list_t *protos;
const char *path;
@@ -498,13 +491,8 @@ static void headset_record_cb(sdp_list_t *recs, int err, gpointer user_data)
device_paths = g_slist_append(device_paths, g_strdup(path));
- reply = dbus_message_new_method_return(pr->msg);
-
- dbus_message_append_args(reply,
- DBUS_TYPE_STRING, &path,
- DBUS_TYPE_INVALID);
-
- send_message_and_unref(pr->conn, reply);
+ g_dbus_send_reply(pr->conn, pr->msg, DBUS_TYPE_STRING, &path,
+ DBUS_TYPE_INVALID);
fail:
pending_req_free(pr);