da2bf9
From 7b9b641a7721f013fb12ab4e2a03423b5ede08c6 Mon Sep 17 00:00:00 2001
da2bf9
From: Lennart Poettering <lennart@poettering.net>
da2bf9
Date: Tue, 9 Oct 2018 22:23:14 +0200
da2bf9
Subject: [PATCH] core: fix unfortunate typo in unit_is_unneeded()
da2bf9
da2bf9
Follow-up for a3c1168ac293f16d9343d248795bb4c246aaff4a.
da2bf9
da2bf9
(cherry picked from commit 93d4cb09d56e670b0c203dd6ec6939e391a0df59)
da2bf9
da2bf9
Resolves: #2040147
da2bf9
---
da2bf9
 src/core/unit.c | 2 +-
da2bf9
 1 file changed, 1 insertion(+), 1 deletion(-)
da2bf9
da2bf9
diff --git a/src/core/unit.c b/src/core/unit.c
da2bf9
index 4de218feac..e2c61ce866 100644
da2bf9
--- a/src/core/unit.c
da2bf9
+++ b/src/core/unit.c
da2bf9
@@ -1956,7 +1956,7 @@ bool unit_is_unneeded(Unit *u) {
da2bf9
                  * restart, then don't clean this one up. */
da2bf9
 
da2bf9
                 HASHMAP_FOREACH_KEY(v, other, u->dependencies[deps[j]], i) {
da2bf9
-                        if (u->job)
da2bf9
+                        if (other->job)
da2bf9
                                 return false;
da2bf9
 
da2bf9
                         if (!UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(other)))