if (r < 0)
return r;
+ session_add_to_gc_queue(session);
+
return sd_bus_reply_method_return(message, NULL);
}
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);
bus_manager_log_shutdown(m, w, action);
- /* 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(m, 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);