Skip to content
Permalink
Browse files
[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 <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Nov 7, 2016
1 parent 9b04af2 commit cb8fd5a9169319c3bbfbfc1c9bbec4f0f8f7ce77
Showing with 3 additions and 3 deletions.
  1. +3 −3 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;
}

0 comments on commit cb8fd5a

Please sign in to comment.