summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-09 02:31:42 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-09 02:31:42 +0100
commitb1491eba40715438b0ac874f2be79d5622b971e1 (patch)
treea3c0dcacce75033c4c7662324f70c0d1f946dd4f /src/core
parentdab5bf859900c0abdbf78c584e4aed42a19768cd (diff)
core: rename unit_destroy_cgroup() to unit_destroy_cgroup_if_empty() since it's not quite as destructive as it sounds nowadays
Diffstat (limited to 'src/core')
-rw-r--r--src/core/cgroup.c3
-rw-r--r--src/core/cgroup.h2
-rw-r--r--src/core/service.c2
-rw-r--r--src/core/unit.c2
4 files changed, 4 insertions, 5 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index af048354e1..6815ca907a 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -782,7 +782,7 @@ int unit_realize_cgroup(Unit *u) {
return unit_realize_cgroup_now(u, manager_state(u->manager));
}
-void unit_destroy_cgroup(Unit *u) {
+void unit_destroy_cgroup_if_empty(Unit *u) {
int r;
assert(u);
@@ -802,7 +802,6 @@ void unit_destroy_cgroup(Unit *u) {
u->cgroup_path = NULL;
u->cgroup_realized = false;
u->cgroup_realized_mask = 0;
-
}
pid_t unit_search_main_pid(Unit *u) {
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index 3c43885bf2..16d661357b 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -109,7 +109,7 @@ CGroupControllerMask unit_get_target_mask(Unit *u);
void unit_update_cgroup_members_masks(Unit *u);
int unit_realize_cgroup(Unit *u);
-void unit_destroy_cgroup(Unit *u);
+void unit_destroy_cgroup_if_empty(Unit *u);
int manager_setup_cgroup(Manager *m);
void manager_shutdown_cgroup(Manager *m, bool delete);
diff --git a/src/core/service.c b/src/core/service.c
index 53a2935e52..bfbe959edb 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -703,7 +703,7 @@ static void service_set_state(Service *s, ServiceState state) {
/* For the inactive states unit_notify() will trim the cgroup,
* but for exit we have to do that ourselves... */
if (state == SERVICE_EXITED && UNIT(s)->manager->n_reloading <= 0)
- unit_destroy_cgroup(UNIT(s));
+ unit_destroy_cgroup_if_empty(UNIT(s));
/* For remain_after_exit services, let's see if we can "release" the
* hold on the console, since unit_notify() only does that in case of
diff --git a/src/core/unit.c b/src/core/unit.c
index 7daf170e29..43280ecd2f 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1783,7 +1783,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
/* Make sure the cgroup is always removed when we become inactive */
if (UNIT_IS_INACTIVE_OR_FAILED(ns))
- unit_destroy_cgroup(u);
+ unit_destroy_cgroup_if_empty(u);
/* Note that this doesn't apply to RemainAfterExit services exiting
* successfully, since there's no change of state in that case. Which is