core/cgroup: use UNIT_IS_INACTIVE_OR_FAILED where appropriate
authorMike Yuan <me@yhndnzj.com>
Wed, 31 Jul 2024 17:53:53 +0000 (19:53 +0200)
committerMike Yuan <me@yhndnzj.com>
Wed, 31 Jul 2024 19:40:28 +0000 (21:40 +0200)
src/core/cgroup.c

index 50dd3dd45d9a4adf3341c32dda7df979f676caa5..3f96f64dad2c143bc13ed1d90db26725641b3358 100644 (file)
@@ -3788,7 +3788,7 @@ static int on_cgroup_empty_event(sd_event_source *s, void *userdata) {
 
         unit_add_to_gc_queue(u);
 
-        if (IN_SET(unit_active_state(u), UNIT_INACTIVE, UNIT_FAILED))
+        if (UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(u)))
                 unit_prune_cgroup(u);
         else if (UNIT_VTABLE(u)->notify_cgroup_empty)
                 UNIT_VTABLE(u)->notify_cgroup_empty(u);