chiark / gitweb /
Handle suspend/hibernate/hybrid-suspend/shutdown/reboot directly
[elogind.git] / src / login / logind-dbus.c
index b735366fe161086601300488b6e3f5ed63db6c0a..301c4de2fe8df691f79da262622730ea5d505f77 100644 (file)
@@ -1422,10 +1422,6 @@ static int execute_shutdown_or_sleep(
                 InhibitWhat w,
                 HandleAction action,
                 sd_bus_error *error) {
-
-        _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-        const char *p;
-        char *c;
         int r;
 
         assert(m);
@@ -1436,26 +1432,10 @@ static int execute_shutdown_or_sleep(
 
         /* FIXME: here do the thing.  */
 
-        r = sd_bus_call_method(
-                        m->bus,
-                        "org.freedesktop.systemd1",
-                        "/org/freedesktop/systemd1",
-                        "org.freedesktop.systemd1.Manager",
-                        "StartUnit",
-                        error,
-                        &reply,
-                        "ss", NULL, "replace-irreversibly");
+        r = shutdown_or_sleep(action);
         if (r < 0)
                 return r;
 
-        r = sd_bus_message_read(reply, "o", &p);
-        if (r < 0)
-                return r;
-
-        c = strdup(p);
-        if (!c)
-                return -ENOMEM;
-
         /* Make sure the lid switch is ignored for a while (?) */
         manager_set_lid_switch_ignore(m, now(CLOCK_MONOTONIC) + m->holdoff_timeout_usec);