From cb8fd5a9169319c3bbfbfc1c9bbec4f0f8f7ce77 Mon Sep 17 00:00:00 2001 From: Simo Piiroinen Date: Mon, 7 Nov 2016 09:51:44 +0200 Subject: [PATCH] [ssu] Use cached SystemBus connection for ssu-queries. MER#1694 If ssu functionality is called in inappropriate state of usb-moded startup, it will implicitly make SystemBus connection. Use cached cached connection, so that attempts to make ssu queries will fail (with error logging) if they done before the main logic has connected to the SystemBus. Signed-off-by: Simo Piiroinen --- src/usb_moded-ssu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/usb_moded-ssu.c b/src/usb_moded-ssu.c index 52d40bc..ba9c206 100644 --- a/src/usb_moded-ssu.c +++ b/src/usb_moded-ssu.c @@ -26,6 +26,7 @@ #include "usb_moded-ssu.h" #include "usb_moded-log.h" +#include "usb_moded-dbus-private.h" /** SSU D-Bus service name */ #define SSU_DBUS_SERVICE "org.nemo.ssu" @@ -74,9 +75,8 @@ usb_moded_get_ssu_display_name(SsuDisplayType type_id) const char *val = 0; DBusError err = DBUS_ERROR_INIT; - if( !(con = dbus_bus_get(DBUS_BUS_SYSTEM, &err)) ) { - log_err("could not connect to system bus: %s: %s", - err.name, err.message); + if( !(con = usb_moded_dbus_get_connection()) ) { + log_err("not connected to system bus"); goto EXIT; }