diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-05-27 18:05:38 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-05-27 18:05:38 +0000 |
commit | ee47f9f75ecc4ea8756f9b301905ec7de5ac07a3 (patch) | |
tree | d3b2cd1783ad7824b79751ada94a625f68bae74c /input | |
parent | 80d6914d167a731d97aff4e25497f84e96e09fe3 (diff) |
Use message sending helpers
Diffstat (limited to 'input')
-rw-r--r-- | input/manager.c | 22 | ||||
-rw-r--r-- | input/server.c | 4 |
2 files changed, 7 insertions, 19 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); diff --git a/input/server.c b/input/server.c index 976b8522..f5861635 100644 --- a/input/server.c +++ b/input/server.c @@ -50,7 +50,7 @@ #include "dbus-service.h" #include "glib-helper.h" -static const char* HID_UUID = "00001124-0000-1000-8000-00805f9b34fb"; +static const char *HID_UUID = "00001124-0000-1000-8000-00805f9b34fb"; static DBusConnection *connection = NULL; @@ -71,7 +71,7 @@ static void cancel_authorization(const char *addr) DBUS_TYPE_STRING, &HID_UUID, DBUS_TYPE_INVALID); - send_message_and_unref(connection, msg); + g_dbus_send_message(connection, msg); } struct authorization_data { |