core: move checking default_dependencies into target_add_default_dependencies. (#5762)

Almost units check default_dependencies within [unit]_add_default_dependencies
except target unit.
This commit is contained in:
iplayinsun 2017-04-21 18:00:47 +09:00 committed by Lennart Poettering
parent a2c74c0ce8
commit 41c237af80

View file

@ -63,6 +63,9 @@ static int target_add_default_dependencies(Target *t) {
assert(t);
if (!UNIT(t)->default_dependencies)
return 0;
/* Imply ordering for requirement dependencies on target
* units. Note that when the user created a contradicting
* ordering manually we won't add anything in here to make
@ -93,7 +96,7 @@ static int target_load(Unit *u) {
return r;
/* This is a new unit? Then let's add in some extras */
if (u->load_state == UNIT_LOADED && u->default_dependencies) {
if (u->load_state == UNIT_LOADED) {
r = target_add_default_dependencies(t);
if (r < 0)
return r;