- if (strv_extend(&argv_utmp, "elogind") < 0)
- return log_oom();
-
- 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;
- m->action_what = 0;
- if (r < 0)
- return r;
-#endif // 0