Commit cb8fd5a9 authored by spiiroin's avatar spiiroin

[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: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent 9b04af27
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "usb_moded-ssu.h" #include "usb_moded-ssu.h"
#include "usb_moded-log.h" #include "usb_moded-log.h"
#include "usb_moded-dbus-private.h"
/** SSU D-Bus service name */ /** SSU D-Bus service name */
#define SSU_DBUS_SERVICE "org.nemo.ssu" #define SSU_DBUS_SERVICE "org.nemo.ssu"
...@@ -74,9 +75,8 @@ usb_moded_get_ssu_display_name(SsuDisplayType type_id) ...@@ -74,9 +75,8 @@ usb_moded_get_ssu_display_name(SsuDisplayType type_id)
const char *val = 0; const char *val = 0;
DBusError err = DBUS_ERROR_INIT; DBusError err = DBUS_ERROR_INIT;
if( !(con = dbus_bus_get(DBUS_BUS_SYSTEM, &err)) ) { if( !(con = usb_moded_dbus_get_connection()) ) {
log_err("could not connect to system bus: %s: %s", log_err("not connected to system bus");
err.name, err.message);
goto EXIT; goto EXIT;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment