chiark / gitweb /
machined: simplifications
[elogind.git] / src / machine / machine-dbus.c
index 150a3f7761bb8c09395b9724c9c3d31cec1aeb5f..ddd6b4b10ebc16799b05b3d6e8c6f1b8fc34ca31 100644 (file)
@@ -210,13 +210,13 @@ int machine_send_create_reply(Machine *m, sd_bus_error *error) {
         c = m->create_message;
         m->create_message = NULL;
 
+        if (error)
+                return sd_bus_reply_method_error(m->manager->bus, c, error);
+
         /* Update the machine state file before we notify the client
          * about the result. */
         machine_save(m);
 
-        if (error)
-                return sd_bus_reply_method_error(m->manager->bus, c, error);
-
         p = machine_bus_path(m);
         if (!p)
                 return -ENOMEM;