diff --git a/src/core/cgroup.c b/src/core/cgroup.c index abc30e3990..c942db8d05 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -2283,8 +2283,11 @@ int unit_attach_pids_to_cgroup(Unit *u, Set *pids, const char *suffix_path) { z = unit_attach_pid_to_cgroup_via_bus(u, pid, suffix_path); if (z < 0) log_unit_info_errno(u, z, "Couldn't move process "PID_FMT" to requested cgroup '%s' (directly or via the system bus): %m", pid, empty_to_root(p)); - else + else { + if (ret >= 0) + ret++; /* Count successful additions */ continue; /* When the bus thing worked via the bus we are fully done for this PID. */ + } } if (ret >= 0)