From: Luiz Augusto von Dentz Date: Wed, 31 Jan 2018 10:55:30 +0000 (-0200) Subject: adapter: Use g_dbus_send_reply whenever possible X-Git-Tag: accepted/tizen/unified/20190522.085452~1^2~191 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8178532723f261bfb509d775999be4740cf01076;p=platform%2Fupstream%2Fbluez.git 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 --- 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;