275528
From 10189fd6be0f547d75bc857860f3ecbbdbc447a6 Mon Sep 17 00:00:00 2001
275528
From: David Herrmann <dh.herrmann@gmail.com>
275528
Date: Fri, 31 Jul 2015 16:52:29 +0200
275528
Subject: [PATCH 261/261] logind: release VT-positions when closing sessions
275528
275528
Make sure we release VT-positions when a session is closed. Otherwise,
275528
lingering sessions will occupy VTs and prevent next logins from
275528
succeeding.
275528
275528
Note that we already release session-devices when closing a session, so
275528
there cannot be anyone using the VT anymore.
275528
---
275528
 src/login/logind-session.c | 6 ++++++
275528
 1 file changed, 6 insertions(+)
275528
275528
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
275528
index 2537d02..9a2da79 100644
275528
--- a/src/login/logind-session.c
275528
+++ b/src/login/logind-session.c
275528
@@ -636,6 +636,9 @@ int session_stop(Session *s, bool force) {
275528
 
275528
         s->timer_event_source = sd_event_source_unref(s->timer_event_source);
275528
 
275528
+        if (s->seat)
275528
+                seat_evict_position(s->seat, s);
275528
+
275528
         /* We are going down, don't care about FIFOs anymore */
275528
         session_remove_fifo(s);
275528
 
275528
@@ -672,6 +675,9 @@ int session_finalize(Session *s) {
275528
 
275528
         s->timer_event_source = sd_event_source_unref(s->timer_event_source);
275528
 
275528
+        if (s->seat)
275528
+                seat_evict_position(s->seat, s);
275528
+
275528
         /* Kill session devices */
275528
         while ((sd = hashmap_first(s->devices)))
275528
                 session_device_free(sd);
275528
-- 
275528
2.4.3
275528