923a60
From 932ae09a155ef463d99d4b4e7cf04aafbcd78a19 Mon Sep 17 00:00:00 2001
923a60
From: Lukas Nykryn <lnykryn@redhat.com>
923a60
Date: Wed, 2 Apr 2014 14:41:26 +0200
923a60
Subject: [PATCH] logind-session: save stopping flag
923a60
923a60
Conflicts:
923a60
	src/login/logind-session.c
923a60
---
923a60
 src/login/logind-session.c | 17 +++++++++++++----
923a60
 1 file changed, 13 insertions(+), 4 deletions(-)
923a60
923a60
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
923a60
index a02a537f7c..d2e7b40124 100644
923a60
--- a/src/login/logind-session.c
923a60
+++ b/src/login/logind-session.c
923a60
@@ -181,12 +181,14 @@ int session_save(Session *s) {
923a60
                 "USER=%s\n"
923a60
                 "ACTIVE=%i\n"
923a60
                 "STATE=%s\n"
923a60
-                "REMOTE=%i\n",
923a60
-                s->user->uid,
923a60
+                "REMOTE=%i\n"
923a60
+                "STOPPING=%i\n",
923a60
+                (unsigned long) s->user->uid,
923a60
                 s->user->name,
923a60
                 session_is_active(s),
923a60
                 session_state_to_string(session_get_state(s)),
923a60
-                s->remote);
923a60
+                s->remote,
923a60
+                s->stopping);
923a60
 
923a60
         if (s->type >= 0)
923a60
                 fprintf(f, "TYPE=%s\n", session_type_to_string(s->type));
923a60
@@ -309,7 +311,8 @@ int session_load(Session *s) {
923a60
                 *uid = NULL,
923a60
                 *realtime = NULL,
923a60
                 *monotonic = NULL,
923a60
-                *controller = NULL;
923a60
+                *controller = NULL,
923a60
+                *stopping = NULL;
923a60
 
923a60
         int k, r;
923a60
 
923a60
@@ -337,6 +340,7 @@ int session_load(Session *s) {
923a60
                            "REALTIME",       &realtime,
923a60
                            "MONOTONIC",      &monotonic,
923a60
                            "CONTROLLER",     &controller,
923a60
+                           "STOPPING",       &stopping,
923a60
                            NULL);
923a60
 
923a60
         if (r < 0)
923a60
@@ -453,6 +457,11 @@ int session_load(Session *s) {
923a60
                         session_restore_vt(s);
923a60
         }
923a60
 
923a60
+        if (stopping) {
923a60
+                k = parse_boolean(stopping);
923a60
+                if (k >= 0)
923a60
+                        s->stopping = k;
923a60
+        }
923a60
         return r;
923a60
 }
923a60