}
char *unit_dbus_path(Unit *u) {
- char *p, *e;
-
assert(u);
if (!u->id)
return NULL;
- if (!(e = bus_path_escape(u->id)))
- return NULL;
-
- p = strappend("/org/freedesktop/systemd1/unit/", e);
- free(e);
-
- return p;
+ return unit_dbus_path_from_name(u->id);
}
int unit_add_cgroup(Unit *u, CGroupBonding *b) {
if (!is_device_path(what))
return 0;
- if (!(e = unit_name_build_escape(what+1, NULL, ".device")))
+ e = unit_name_from_path(what, ".device");
+ if (!e)
return -ENOMEM;
r = manager_load_unit(u->manager, e, NULL, NULL, &device);