summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-06-13 18:22:08 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-06-13 18:42:02 +0200
commit48899192a7b28b6a338cc8ec18aa35ccd8867acb (patch)
treea5fa3b09e7339b04c51c107549f65846cecf26cf /src/core
parent1c291cf34cb22c8ca5ec0db122bd5e8bfabe9ac5 (diff)
unit-name: introduce unit_dbus_path_from_name()
Use the same function in core and in systemctl. get_unit_path() in systemctl becomes unnecessary.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/unit.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index f53bdd5a91..4cffc57793 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -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) {