mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
logind-dbus: minor modernization
This commit is contained in:
@@ -1748,6 +1748,7 @@ static int execute_shutdown_or_sleep(
|
||||
int r;
|
||||
|
||||
assert(m);
|
||||
assert(!m->action_job);
|
||||
assert(a);
|
||||
|
||||
if (a->inhibit_what == INHIBIT_SHUTDOWN)
|
||||
@@ -1767,9 +1768,11 @@ static int execute_shutdown_or_sleep(
|
||||
if (r < 0)
|
||||
goto error;
|
||||
|
||||
r = free_and_strdup(&m->action_job, p);
|
||||
if (r < 0)
|
||||
m->action_job = strdup(p);
|
||||
if (!m->action_job) {
|
||||
r = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
|
||||
m->delayed_action = a;
|
||||
|
||||
@@ -2401,8 +2404,9 @@ static int manager_scheduled_shutdown_handler(
|
||||
|
||||
/* Don't allow multiple jobs being executed at the same time */
|
||||
if (m->delayed_action) {
|
||||
r = -EALREADY;
|
||||
log_error("Scheduled shutdown to %s failed: shutdown or sleep operation already in progress", a->target);
|
||||
r = log_error_errno(SYNTHETIC_ERRNO(EALREADY),
|
||||
"Scheduled shutdown to %s failed: shutdown or sleep operation already in progress.",
|
||||
a->target);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user