chiark / gitweb /
Remove six unused variables and add annotation
[elogind.git] / src / machine / machine-dbus.c
index 424f98edd56cd81f6497c065930a78e71c79f3b2..ceab96e07832d375e3ae801f5dd98002a9edd8a5 100644 (file)
@@ -109,7 +109,7 @@ static int get_machine_for_path(Manager *m, const char *path, Machine **_machine
         if (!startswith(path, "/org/freedesktop/machine1/machine/"))
                 return -EINVAL;
 
-        e = bus_path_unescape(path + 32);
+        e = bus_path_unescape(path + 34);
         if (!e)
                 return -ENOMEM;
 
@@ -130,6 +130,7 @@ static const BusProperty bus_machine_machine_properties[] = {
         { "TimestampMonotonic",     bus_property_append_usec,          "t", offsetof(Machine, timestamp.monotonic) },
         { "Service",                bus_property_append_string,        "s", offsetof(Machine, service),            true },
         { "Scope",                  bus_property_append_string,        "s", offsetof(Machine, scope),              true },
+        { "Leader",                 bus_property_append_pid,           "u", offsetof(Machine, leader)              },
         { "Class",                  bus_machine_append_class,          "s", offsetof(Machine, class)               },
         { "State",                  bus_machine_append_state,          "s", 0                                      },
         { "RootDirectory",          bus_property_append_string,        "s", offsetof(Machine, root_directory),     true },
@@ -349,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();