mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 11:55:44 +03:00
add new unit_add_dependency_by_name() call
This commit is contained in:
parent
1c24e7bd12
commit
09b6b09f44
13
unit.c
13
unit.c
@ -836,6 +836,19 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other) {
|
|||||||
return 0;
|
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) {
|
const char *unit_path(void) {
|
||||||
char *e;
|
char *e;
|
||||||
|
|
||||||
|
1
unit.h
1
unit.h
@ -196,6 +196,7 @@ void unit_free(Unit *u);
|
|||||||
|
|
||||||
int unit_add_name(Unit *u, const char *name);
|
int unit_add_name(Unit *u, const char *name);
|
||||||
int unit_add_dependency(Unit *u, UnitDependency d, Unit *other);
|
int unit_add_dependency(Unit *u, UnitDependency d, Unit *other);
|
||||||
|
int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name);
|
||||||
|
|
||||||
void unit_add_to_load_queue(Unit *u);
|
void unit_add_to_load_queue(Unit *u);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user