- if (HANDLE_REBOOT == action) {
- if (strv_extend(&argv_utmp, "reboot") < 0)
- return log_oom();
- } else {
- if (strv_extend(&argv_utmp, "shutdown") < 0)
- return log_oom();
- }
-
- /* This comes from our patched update-utmp/update-utmp.c */
- update_utmp(2, argv_utmp, m->bus);
- strv_free(argv_utmp);
- }
-
- /* Now perform the requested action */
- r = shutdown_or_sleep(m, action);
-
- /* no more pending actions, whether this failed or not */
- m->pending_action = HANDLE_IGNORE;
- if (r < 0)
- return r;
-
- /* As elogind can not rely on a systemd manager to call all
- * sleeping processes to wake up, we have to tell them all
- * by ourselves. */
- if (w == INHIBIT_SLEEP) {
- send_prepare_for(m, w, false);
- m->action_what = 0;
- } else
- m->action_what = w;
-#endif // 0