driver/activatable: consider the driver name to be activatable
This name is obviously always active, but include it in
ListActivatableNames() and let StartServiceByName() succeed on it.
@@ -916,6 +916,7 @@ static int driver_method_list_activatable_names(Peer *peer, CDVar *in_v, CDVar *
return error_trace(r);
c_dvar_write(out_v, "([");
+ c_dvar_write(out_v, "s", "org.freedesktop.DBus");
for (CRBNode *n = c_rbtree_first(&peer->bus->names.name_tree); n; n = c_rbnode_next(n)) {
Name *name = c_container_of(n, Name, registry_node);
@@ -967,6 +968,9 @@ static int driver_method_start_service_by_name(Peer *peer, CDVar *in_v, CDVar *o
if (flags)
return DRIVER_E_UNEXPECTED_FLAGS; /* XXX */
+ if (!strcmp(service, "org.freedesktop.DBus")) {
+ reply = DBUS_START_REPLY_ALREADY_RUNNING;
+ } else {
name = name_registry_find_name(&peer->bus->names, service);
if (!name)
return DRIVER_E_NAME_NOT_FOUND; /* XXX */
@@ -988,6 +992,7 @@ static int driver_method_start_service_by_name(Peer *peer, CDVar *in_v, CDVar *o
} else {
reply = DBUS_START_REPLY_ALREADY_RUNNING;
}
+ }
c_dvar_write(out_v, "(u)", reply);
