return r;
r = sd_bus_message_append(reply, "st",
- m->scheduled_shutdown_type ? handle_action_to_string(m->scheduled_shutdown_type->handle) : NULL,
+ m->scheduled_shutdown_action ? handle_action_to_string(m->scheduled_shutdown_action->handle) : NULL,
m->scheduled_shutdown_timeout);
if (r < 0)
return r;
reset_scheduled_shutdown(m);
m->scheduled_shutdown_timeout = 0;
- m->scheduled_shutdown_type = a;
+ m->scheduled_shutdown_action = a;
(void) setup_wall_message_timer(m, message);
return;
/* assign parsed type only after we know usec is also valid */
- m->scheduled_shutdown_type = handle_action_lookup(handle);
+ m->scheduled_shutdown_action = handle_action_lookup(handle);
if (warn_wall) {
r = parse_boolean(warn_wall);
int r;
assert(m);
- assert(m->scheduled_shutdown_type);
+ assert(m->scheduled_shutdown_action);
r = mkdir_parents_label(SHUTDOWN_SCHEDULE_FILE, 0755);
if (r < 0)
serialize_usec(f, "USEC", m->scheduled_shutdown_timeout);
serialize_item_format(f, "WARN_WALL", "%s", one_zero(m->enable_wall_messages));
- serialize_item_format(f, "MODE", "%s", handle_action_to_string(m->scheduled_shutdown_type->handle));
+ serialize_item_format(f, "MODE", "%s", handle_action_to_string(m->scheduled_shutdown_action->handle));
serialize_item_format(f, "UID", UID_FMT, m->scheduled_shutdown_uid);
if (m->scheduled_shutdown_tty)
m->wall_message_timeout_source = sd_event_source_unref(m->wall_message_timeout_source);
m->nologin_timeout_source = sd_event_source_unref(m->nologin_timeout_source);
- m->scheduled_shutdown_type = NULL;
+ m->scheduled_shutdown_action = NULL;
m->scheduled_shutdown_timeout = USEC_INFINITY;
m->scheduled_shutdown_uid = UID_INVALID;
m->scheduled_shutdown_tty = mfree(m->scheduled_shutdown_tty);
assert(m);
- a = m->scheduled_shutdown_type;
+ a = m->scheduled_shutdown_action;
assert(a);
/* Don't allow multiple jobs being executed at the same time */
return 0;
}
- r = bus_manager_shutdown_or_sleep_now_or_later(m, m->scheduled_shutdown_type, &error);
+ r = bus_manager_shutdown_or_sleep_now_or_later(m, m->scheduled_shutdown_action, &error);
if (r < 0) {
log_error_errno(r, "Scheduled shutdown to %s failed: %m", a->target);
goto error;
if (r != 0)
return r;
- m->scheduled_shutdown_type = a;
+ m->scheduled_shutdown_action = a;
m->shutdown_dry_run = dry_run;
m->scheduled_shutdown_timeout = elapse;
assert(m);
assert(message);
- cancelled = m->scheduled_shutdown_type
- && !IN_SET(m->scheduled_shutdown_type->handle, HANDLE_IGNORE, _HANDLE_ACTION_INVALID);
+ cancelled = m->scheduled_shutdown_action
+ && !IN_SET(m->scheduled_shutdown_action->handle, HANDLE_IGNORE, _HANDLE_ACTION_INVALID);
if (!cancelled)
return sd_bus_reply_method_return(message, "b", false);
- a = m->scheduled_shutdown_type;
+ a = m->scheduled_shutdown_action;
if (!a->polkit_action)
return sd_bus_error_set(error, SD_BUS_ERROR_AUTH_FAILED, "Unsupported shutdown type");
assert(m);
- if (!m->enable_wall_messages || !m->scheduled_shutdown_type)
+ if (!m->enable_wall_messages || !m->scheduled_shutdown_action)
return 0;
left = m->scheduled_shutdown_timeout > n;
r = asprintf(&l, "%s%sThe system is going down for %s %s%s!",
strempty(m->wall_message),
isempty(m->wall_message) ? "" : "\n",
- handle_action_to_string(m->scheduled_shutdown_type->handle),
+ handle_action_to_string(m->scheduled_shutdown_action->handle),
left ? "at " : "NOW",
left ? FORMAT_TIMESTAMP(m->scheduled_shutdown_timeout) : "");
if (r < 0) {
/* wall message handling */
- if (!m->scheduled_shutdown_type)
+ if (!m->scheduled_shutdown_action)
return 0;
if (elapse > 0 && elapse < n)
usec_t inhibit_delay_max;
usec_t user_stop_delay;
- /* If a shutdown/suspend was delayed due to an inhibitor this
- contains the action we are supposed to start after the
- delay is over */
+ /* If a shutdown/suspend was delayed due to an inhibitor this contains the action we are supposed to
+ * start after the delay is over */
const HandleActionData *delayed_action;
- /* If a shutdown/suspend is currently executed, then this is
- * the job of it */
+ /* If a shutdown/suspend is currently executed, then this is the job of it */
char *action_job;
sd_event_source *inhibit_timeout_source;
- const HandleActionData *scheduled_shutdown_type;
+ const HandleActionData *scheduled_shutdown_action;
usec_t scheduled_shutdown_timeout;
sd_event_source *scheduled_shutdown_timeout_source;
uid_t scheduled_shutdown_uid;