diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-28 06:43:23 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-28 06:43:23 +0100 |
commit | 09b6b09f44b36b52b8a20ba18446e3ec2926c110 (patch) | |
tree | 1719b3e66ce9f114b7e8b10bfa689073bf02230f /unit.c | |
parent | 1c24e7bd1286d16a7125aeeee0470ea0685c8318 (diff) |
add new unit_add_dependency_by_name() call
Diffstat (limited to 'unit.c')
-rw-r--r-- | unit.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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; |