unit: simplify things a little by introducing API to add two dependencies in one step

This commit is contained in:
Lennart Poettering
2010-07-03 19:46:38 +02:00
parent c5da34ef1b
commit 2c966c038d
8 changed files with 72 additions and 45 deletions
+1 -5
View File
@@ -262,11 +262,7 @@ static int mount_add_target_links(Mount *m) {
if ((r = unit_load_related_unit(UNIT(m), ".automount", &am)) < 0)
return r;
if ((r = unit_add_dependency(tu, UNIT_WANTS, UNIT(am), true)) < 0)
return r;
return unit_add_dependency(UNIT(am), UNIT_BEFORE, tu, true);
return unit_add_two_dependencies(tu, UNIT_AFTER, UNIT_WANTS, UNIT(am), true);
} else {
if (!noauto && handle)