From 4dc24025a4456ebd72edf8edf9af7870e51ebf4b Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 7 Nov 2014 21:42:58 -0600 Subject: [PATCH] dbus: Add enable_debug parameter to dbus_init --- src/dbus.c | 7 +++++-- src/dbus.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dbus.c b/src/dbus.c index 3ec1f524..987600f1 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -123,10 +123,13 @@ struct l_dbus *dbus_get_bus(void) return g_dbus; } -bool dbus_init(void) +bool dbus_init(bool enable_debug) { g_dbus = l_dbus_new_default(L_DBUS_SYSTEM_BUS); - l_dbus_set_debug(g_dbus, do_debug, "[DBUS] ", NULL); + + if (enable_debug) + l_dbus_set_debug(g_dbus, do_debug, "[DBUS] ", NULL); + l_dbus_set_ready_handler(g_dbus, ready_callback, g_dbus, NULL); l_dbus_set_disconnect_handler(g_dbus, disconnect_callback, NULL, NULL); diff --git a/src/dbus.h b/src/dbus.h index 8622e81b..a4cc5219 100644 --- a/src/dbus.h +++ b/src/dbus.h @@ -45,5 +45,5 @@ void dbus_dict_append_bool(struct l_dbus_message_builder *builder, struct l_dbus_message *dbus_error_busy(struct l_dbus_message *msg); struct l_dbus_message *dbus_error_failed(struct l_dbus_message *msg); -bool dbus_init(void); +bool dbus_init(bool enable_debug); bool dbus_exit(void);