From: Yu Watanabe Date: Tue, 15 Nov 2022 14:08:35 +0000 (+0900) Subject: core/unit: fix logic of dropping self-referencing dependencies X-Git-Tag: v253-rc1~252^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=53e0e6ef0eea396bb432cbfc1f2f6ea1272ff1f1;p=thirdparty%2Fsystemd.git core/unit: fix logic of dropping self-referencing dependencies Fixes a bug in 15ed3c3a188cf7fa5a60ae508fc7a3ed048d2220. --- diff --git a/src/core/unit.c b/src/core/unit.c index 1a580157afa..a9052428e47 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -1131,10 +1131,11 @@ static void unit_merge_dependencies(Unit *u, Unit *other) { } } else { assert_se(r >= 0); - TAKE_PTR(other_deps); if (hashmap_remove(other_deps, u)) unit_maybe_warn_about_dependency(u, other->id, UNIT_DEPENDENCY_FROM_PTR(dt)); + + TAKE_PTR(other_deps); } }