daandemeyer / rpms / systemd

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