From a7d4f3f8b8a6064716b360641b886393870a65c6 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 31 Jan 2018 08:55:30 -0200 Subject: [PATCH] adapter: Use g_dbus_send_reply whenever possible This convert calls of g_dbus_create_reply + g_dbus_send_message to just g_dbus_send_reply as that is simpler to maintain and saver as that always check if the reply could be constructed properly. --- src/adapter.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 0a25ae27e..50cf46b11 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1469,9 +1469,8 @@ static void start_discovery_complete(uint8_t status, uint16_t length, adapter->filtered_discovery = false; if (client->msg) { - reply = g_dbus_create_reply(client->msg, - DBUS_TYPE_INVALID); - g_dbus_send_message(dbus_conn, reply); + g_dbus_send_reply(dbus_conn, client->msg, + DBUS_TYPE_INVALID); dbus_message_unref(client->msg); client->msg = NULL; } @@ -1860,10 +1859,8 @@ static void stop_discovery_complete(uint8_t status, uint16_t length, goto done; } - if (client->msg) { - reply = g_dbus_create_reply(client->msg, DBUS_TYPE_INVALID); - g_dbus_send_message(dbus_conn, reply); - } + if (client->msg) + g_dbus_send_reply(dbus_conn, client->msg, DBUS_TYPE_INVALID); adapter->discovery_type = 0x00; adapter->discovery_enable = 0x00; -- 2.47.3