Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 cb8fd5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/usb_moded-ssu.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit cb8fd5a

Please sign in to comment.