diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-07-07 03:43:39 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-07-07 04:13:19 +0200 |
commit | f4579ce704b9db0358b90c282da9536410a4df5a (patch) | |
tree | 84cf4c29623e56489d4bec194e92eefd1910d85f /src/dbus-common.c | |
parent | ad678a066b4ba5d8914dd7d5a4093572841205cf (diff) |
dbus: don't try to run AddMatch when connected to a private bus
Diffstat (limited to 'src/dbus-common.c')
-rw-r--r-- | src/dbus-common.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dbus-common.c b/src/dbus-common.c index 504eefbbb0..11d989d7c3 100644 --- a/src/dbus-common.c +++ b/src/dbus-common.c @@ -54,7 +54,7 @@ int bus_check_peercred(DBusConnection *c) { return 1; } -int bus_connect(DBusBusType t, DBusConnection **_bus, DBusError *error) { +int bus_connect(DBusBusType t, DBusConnection **_bus, bool *private, DBusError *error) { DBusConnection *bus; assert(_bus); @@ -71,9 +71,16 @@ int bus_connect(DBusBusType t, DBusConnection **_bus, DBusError *error) { dbus_set_error_const(error, DBUS_ERROR_ACCESS_DENIED, "Failed to verify owner of bus."); return -EACCES; } + + if (private) + *private = true; + } else { if (!(bus = dbus_bus_get(t, error))) return -EIO; + + if (private) + *private = false; } dbus_connection_set_exit_on_disconnect(bus, FALSE); |