diff options
author | Tom Gundersen <teg@jklm.no> | 2015-11-11 23:14:12 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-11-11 23:14:12 +0100 |
commit | fb5c8184a99ed3379d6a48eed2b83f6f7ee9ee18 (patch) | |
tree | f8144b0ba312e12a221ec9b1c0f7f937fb5aec9d /src/core/slice.c | |
parent | a9ae08421eac6080d68c03c503c1673eea9f37b3 (diff) | |
parent | ee735086f8670be1591fa9593e80dd60163a7a2f (diff) |
Merge pull request #1854 from poettering/unit-deps
Dependency engine improvements
Diffstat (limited to 'src/core/slice.c')
-rw-r--r-- | src/core/slice.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/slice.c b/src/core/slice.c index 2aa3fbf8be..39dabae055 100644 --- a/src/core/slice.c +++ b/src/core/slice.c @@ -85,6 +85,9 @@ static int slice_add_default_dependencies(Slice *s) { assert(s); + if (!UNIT(s)->default_dependencies) + return 0; + /* Make sure slices are unloaded on shutdown */ r = unit_add_two_dependencies_by_name( UNIT(s), @@ -96,7 +99,6 @@ static int slice_add_default_dependencies(Slice *s) { return 0; } - static int slice_verify(Slice *s) { _cleanup_free_ char *parent = NULL; int r; @@ -144,11 +146,9 @@ static int slice_load(Unit *u) { if (r < 0) return r; - if (u->default_dependencies) { - r = slice_add_default_dependencies(s); - if (r < 0) - return r; - } + r = slice_add_default_dependencies(s); + if (r < 0) + return r; } return slice_verify(s); |