chiark / gitweb /
service: don't hit an assert if a service unit changes type and we get a spurious...
[elogind.git] / src / core / unit.c
index ba4c7d5b32838d1e4a671b345d6a2243f534a980..3950c43f5e217c66c48a39291827594de41610e2 100644 (file)
@@ -258,6 +258,9 @@ bool unit_check_gc(Unit *u) {
         if (unit_active_state(u) != UNIT_INACTIVE)
                 return true;
 
+        if (u->refs)
+                return true;
+
         if (UNIT_VTABLE(u)->check_gc)
                 if (UNIT_VTABLE(u)->check_gc(u))
                         return true;
@@ -1324,7 +1327,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
         /* Note that this is called for all low-level state changes,
          * even if they might map to the same high-level
          * UnitActiveState! That means that ns == os is OK an expected
-         * behaviour here. For example: if a mount point is remounted
+         * behavior here. For example: if a mount point is remounted
          * this function will be called too! */
 
         if (u->manager->n_reloading <= 0) {