unit: fix unit_check_unneeded() dependency iteration
authorLennart Poettering <lennart@poettering.net>
Tue, 19 May 2015 13:42:03 +0000 (15:42 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 19 May 2015 13:42:42 +0000 (15:42 +0200)
Fixes a regression introduced in be7d9ff730cb88d7c6a869dd5c47754c78ceaef2.

src/core/unit.c

index 42c7566..f7d6289 100644 (file)
@@ -1618,7 +1618,7 @@ static void unit_check_unneeded(Unit *u) {
                 return;
 
         for (j = 0; j < ELEMENTSOF(needed_dependencies); j++)
-                SET_FOREACH(other, u->dependencies[j], i)
+                SET_FOREACH(other, u->dependencies[needed_dependencies[j]], i)
                         if (unit_active_or_pending(other))
                                 return;