diff options
author | iplayinsun <iplayinsun@gmail.com> | 2017-04-21 18:00:47 +0900 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-04-21 11:00:47 +0200 |
commit | 41c237af809c2145f1d9a74a8288dd5a54e5eb0b (patch) | |
tree | 9cc4a9dc56ddd016591f4c69ec66f9da0f49d779 | |
parent | a2c74c0ce83ff16fad95fe18d8e7ae0e2817f672 (diff) | |
download | systemd-41c237af809c2145f1d9a74a8288dd5a54e5eb0b.tar.gz systemd-41c237af809c2145f1d9a74a8288dd5a54e5eb0b.tar.bz2 systemd-41c237af809c2145f1d9a74a8288dd5a54e5eb0b.zip |
core: move checking default_dependencies into target_add_default_dependencies. (#5762)
Almost units check default_dependencies within [unit]_add_default_dependencies
except target unit.
-rw-r--r-- | src/core/target.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/target.c b/src/core/target.c index ff0d764fb5..2a58dd394d 100644 --- a/src/core/target.c +++ b/src/core/target.c @@ -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; |