summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriplayinsun <iplayinsun@gmail.com>2017-04-21 18:00:47 +0900
committerLennart Poettering <lennart@poettering.net>2017-04-21 11:00:47 +0200
commit41c237af809c2145f1d9a74a8288dd5a54e5eb0b (patch)
tree9cc4a9dc56ddd016591f4c69ec66f9da0f49d779
parenta2c74c0ce83ff16fad95fe18d8e7ae0e2817f672 (diff)
downloadsystemd-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.c5
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;