From a31222b232eb4312301b232a3f28f144ab144895 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Mon, 1 Jan 2024 20:08:11 +0800 Subject: [PATCH] logind: use handle_action_to_string where appropriate Since 138224fc807091d31f19a3b22f066d6044626001, HandleActionData records the corresponding HandleAction. Let's use it instead of relying on inhibit_what when mapping to string. --- src/login/logind-action.c | 4 ++-- src/login/logind-dbus.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/login/logind-action.c b/src/login/logind-action.c index e8951073788..acef32679a1 100644 --- a/src/login/logind-action.c +++ b/src/login/logind-action.c @@ -209,8 +209,8 @@ static int handle_action_execute( if (m->delayed_action) return log_debug_errno(SYNTHETIC_ERRNO(EALREADY), - "Action already in progress (%s), ignoring requested %s operation.", - inhibit_what_to_string(m->delayed_action->inhibit_what), + "Action %s already in progress, ignoring requested %s operation.", + handle_action_to_string(m->delayed_action->handle), handle_action_to_string(handle)); inhibit_operation = ASSERT_PTR(handle_action_lookup(handle))->inhibit_what; diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 898c6f752b6..b310a7cee86 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -4011,7 +4011,7 @@ int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *err if (m->action_job && streq(m->action_job, path)) { assert(m->delayed_action); - log_info("Operation '%s' finished.", inhibit_what_to_string(m->delayed_action->inhibit_what)); + log_info("Operation '%s' finished.", handle_action_to_string(m->delayed_action->handle)); /* Tell people that they now may take a lock again */ (void) send_prepare_for(m, m->delayed_action, false); -- 2.47.3