summaryrefslogtreecommitdiff
path: root/src/logind-session.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-06-24 20:41:56 +0200
committerLennart Poettering <lennart@poettering.net>2011-06-24 20:41:56 +0200
commit1713813de365486617ab87899f950e9b6ec928ef (patch)
treef2c7c33d8b039935dbaea697f2432bdff601d370 /src/logind-session.c
parentdec15e9263cadae02f4f51463860248af40475d0 (diff)
logind: remove a session when its cgroup is gone
Diffstat (limited to 'src/logind-session.c')
-rw-r--r--src/logind-session.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/logind-session.c b/src/logind-session.c
index 74f8ad1b0c..9278f30754 100644
--- a/src/logind-session.c
+++ b/src/logind-session.c
@@ -83,6 +83,9 @@ void session_free(Session *s) {
LIST_REMOVE(Session, sessions_by_seat, s->seat->sessions, s);
}
+ if (s->cgroup_path)
+ hashmap_remove(s->manager->cgroups, s->cgroup_path);
+
free(s->cgroup_path);
strv_free(s->controllers);
@@ -468,6 +471,8 @@ static int session_create_cgroup(Session *s) {
}
}
+ hashmap_put(s->manager->cgroups, s->cgroup_path, s);
+
return 0;
}
@@ -562,6 +567,8 @@ static int session_kill_cgroup(Session *s) {
STRV_FOREACH(k, s->user->manager->controllers)
cg_trim(*k, s->cgroup_path, true);
+ hashmap_remove(s->manager->cgroups, s->cgroup_path);
+
free(s->cgroup_path);
s->cgroup_path = NULL;