Blame SOURCES/0005-logind-session-save-stopping-flag.patch

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