summaryrefslogtreecommitdiffstats
path: root/src/shared/bus-wait-for-units.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-01-29 21:36:56 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-01-29 21:43:56 +0100
commit853b94863cf26d084454edd63ce987cc7ab0505a (patch)
treecada8e0e333292a4143f128746a7d0f91593402e /src/shared/bus-wait-for-units.c
parentci: update GHActions once a month (diff)
downloadsystemd-853b94863cf26d084454edd63ce987cc7ab0505a.tar.xz
systemd-853b94863cf26d084454edd63ce987cc7ab0505a.zip
bus-util: retrieve bus error from message
The error in argument is not input, but used for output.
Diffstat (limited to 'src/shared/bus-wait-for-units.c')
-rw-r--r--src/shared/bus-wait-for-units.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/shared/bus-wait-for-units.c b/src/shared/bus-wait-for-units.c
index 29620e0d1b..c867f1cbfd 100644
--- a/src/shared/bus-wait-for-units.c
+++ b/src/shared/bus-wait-for-units.c
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "bus-error.h"
#include "bus-map-properties.h"
#include "bus-wait-for-units.h"
#include "hashmap.h"
@@ -288,19 +289,22 @@ static int on_properties_changed(sd_bus_message *m, void *userdata, sd_bus_error
return 0;
}
-static int on_get_all_properties(sd_bus_message *m, void *userdata, sd_bus_error *error) {
+static int on_get_all_properties(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
WaitForItem *item = userdata;
+ const sd_bus_error *e;
int r;
assert(item);
- if (sd_bus_error_is_set(error)) {
+ e = sd_bus_message_get_error(m);
+ if (e) {
BusWaitForUnits *d = item->parent;
d->has_failed = true;
- log_debug_errno(sd_bus_error_get_errno(error), "GetAll() failed for %s: %s",
- item->bus_path, error->message);
+ r = sd_bus_error_get_errno(e);
+ log_debug_errno(r, "GetAll() failed for %s: %s",
+ item->bus_path, bus_error_message(e, r));
call_unit_callback_and_wait(d, item, false);
bus_wait_for_units_check_ready(d);