[systemd-commits] TODO src/login src/machine

Lennart Poettering lennart at kemper.freedesktop.org
Fri Jul 26 10:04:00 PDT 2013


 TODO                            |    2 --
 src/login/logind-dbus.c         |    5 ++---
 src/login/logind-session-dbus.c |    4 ++++
 src/machine/machine-dbus.c      |    4 ++++
 src/machine/machined-dbus.c     |    5 ++---
 5 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 76e665855edef5b7103cb09d114377d477bfae02
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jul 26 18:59:46 2013 +0200

    logind: update the session state file before we send out the CreateSession() reply
    
    https://bugs.freedesktop.org/show_bug.cgi?id=67273

diff --git a/TODO b/TODO
index 35ce46f..57ff331 100644
--- a/TODO
+++ b/TODO
@@ -51,8 +51,6 @@ CGroup Rework Completion:
 
 Features:
 
-* remove systemctl load-unit
-
 * journalctl: instead --after-cursor= maybe have a --cursor=XYZ+1 syntax?
 
 * given that logind/machined now let PID 1 do all nasty work we can
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index b5e975a..7b9bd20 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -2368,9 +2368,8 @@ DBusHandlerResult bus_message_filter(
                                                         dbus_set_error(&error, BUS_ERROR_JOB_FAILED, "Start job for unit %s failed with '%s'", unit, result);
                                                         session_send_create_reply(s, &error);
                                                 }
-                                        }
-
-                                        session_save(s);
+                                        } else
+                                                session_save(s);
                                 }
 
                                 session_add_to_gc_queue(s);
diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
index 210f756..2cc4d85 100644
--- a/src/login/logind-session-dbus.c
+++ b/src/login/logind-session-dbus.c
@@ -592,6 +592,10 @@ int session_send_create_reply(Session *s, DBusError *error) {
                         return log_oom();
         }
 
+        /* Update the state file before we notify the client about the
+         * result */
+        session_save(s);
+
         if (!dbus_connection_send(s->manager->bus, reply, NULL))
                 return log_oom();
 
diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
index 6e1b8f8..ceab96e 100644
--- a/src/machine/machine-dbus.c
+++ b/src/machine/machine-dbus.c
@@ -350,6 +350,10 @@ int machine_send_create_reply(Machine *m, DBusError *error) {
                         return log_oom();
         }
 
+        /* Update the machine state file before we notify the client
+         * about the result. */
+        machine_save(m);
+
         if (!dbus_connection_send(m->manager->bus, reply, NULL))
                 return log_oom();
 
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 6c4d50b..5a016e7 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -551,9 +551,8 @@ DBusHandlerResult bus_message_filter(
                                                 dbus_set_error(&error, BUS_ERROR_JOB_FAILED, "Start job for unit %s failed with '%s'", unit, result);
                                                 machine_send_create_reply(mm, &error);
                                         }
-                                }
-
-                                machine_save(mm);
+                                } else
+                                        machine_save(mm);
                         }
 
                         machine_add_to_gc_queue(mm);



More information about the systemd-commits mailing list