From 8178532723f261bfb509d775999be4740cf01076 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. Change-Id: I7514f10f22e4c629892796c929cb556a0fb07a97 Signed-off-by: Amit Purwar --- src/adapter.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index de5bdee..f9dca5f 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1992,9 +1992,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; } @@ -2657,10 +2656,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.7.4