summaryrefslogtreecommitdiff
path: root/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'unit.c')
-rw-r--r--unit.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/unit.c b/unit.c
index 4076120920..a5f4ac7676 100644
--- a/unit.c
+++ b/unit.c
@@ -836,6 +836,19 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other) {
return 0;
}
+int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name) {
+ Unit *other;
+ int r;
+
+ if ((r = manager_load_unit(u->meta.manager, name, &other)) < 0)
+ return r;
+
+ if ((r = unit_add_dependency(u, d, other)) < 0)
+ return r;
+
+ return 0;
+}
+
const char *unit_path(void) {
char *e;