From 98f8c18db0edda121db05171fbaf35c342fd86b2 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Sun, 30 Jan 2022 05:38:35 +0900
Subject: [PATCH] login: use bus_error_message() at one more place

(cherry picked from commit 80c8c786a314bceba180fac5506e72aa48c0764a)
(cherry picked from commit 048487c094a149e99b4067c8cd2d3974a8f17397)

Conflict:NA
Reference:https://github.com/systemd/systemd/commit/98f8c18db0edda121db05171fbaf35c342fd86b2
---
 src/login/logind-user.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index a2c468e8dd..3c65867cb6 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -358,15 +358,19 @@ static void user_start_service(User *u) {
 
 static int update_slice_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
         _cleanup_(user_record_unrefp) UserRecord *ur = userdata;
+        const sd_bus_error *e;
+        int r;
 
         assert(m);
         assert(ur);
 
-        if (sd_bus_message_is_method_error(m, NULL)) {
-                log_warning_errno(sd_bus_message_get_errno(m),
+        e = sd_bus_message_get_error(m);
+        if (e) {
+                r = sd_bus_error_get_errno(e);
+                log_warning_errno(r,
                                   "Failed to update slice of %s, ignoring: %s",
                                   ur->user_name,
-                                  sd_bus_message_get_error(m)->message);
+                                  bus_error_message(e, r));
 
                 return 0;
         }
-- 
2.33.0

