unit-name: introduce unit_dbus_path_from_name()

Use the same function in core and in systemctl.
get_unit_path() in systemctl becomes unnecessary.
This commit is contained in:
Michal Schmidt
2012-06-13 18:42:02 +02:00
parent 1c291cf34c
commit 48899192a7
4 changed files with 21 additions and 85 deletions
+1 -9
View File
@@ -1835,20 +1835,12 @@ int set_unit_path(const char *p) {
}
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) {