]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: add optional error parameter in bus_print_all_properties()
authorNick Rosbrook <enr0n@ubuntu.com>
Tue, 27 May 2025 15:58:29 +0000 (11:58 -0400)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 27 May 2025 19:40:08 +0000 (04:40 +0900)
While here, remove the unused found_properties parameter.

This is preparation for another commit.

src/shared/bus-print-properties.c
src/shared/bus-print-properties.h

index 5ea670599a37c24b4f617e4facd0868863887e33..9d0d9377b279d2216a02842ef870ba1d5ca9ad38 100644 (file)
@@ -428,10 +428,9 @@ int bus_print_all_properties(
                 bus_message_print_t func,
                 char **filter,
                 BusPrintPropertyFlags flags,
-                Set **found_properties) {
+                sd_bus_error *reterr) {
 
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
-        _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         int r;
 
         assert(bus);
@@ -442,11 +441,11 @@ int bus_print_all_properties(
                         path,
                         "org.freedesktop.DBus.Properties",
                         "GetAll",
-                        &error,
+                        reterr,
                         &reply,
                         "s", "");
         if (r < 0)
                 return r;
 
-        return bus_message_print_all_properties(reply, func, filter, flags, found_properties);
+        return bus_message_print_all_properties(reply, func, filter, flags, NULL);
 }
index 9bbf8a9eceb04c4e8d6cdefac60003f16ccc0a20..0ae450c1ded67642af8ecfbef4077f8dd5667e87 100644 (file)
@@ -13,4 +13,4 @@ typedef int (*bus_message_print_t) (const char *name, const char *expected_value
 int bus_print_property_value(const char *name, const char *expected_value, BusPrintPropertyFlags flags, const char *value);
 int bus_print_property_valuef(const char *name, const char *expected_value, BusPrintPropertyFlags flags, const char *fmt, ...) _printf_(4,5);
 int bus_message_print_all_properties(sd_bus_message *m, bus_message_print_t func, char **filter, BusPrintPropertyFlags flags, Set **found_properties);
-int bus_print_all_properties(sd_bus *bus, const char *dest, const char *path, bus_message_print_t func, char **filter, BusPrintPropertyFlags flags, Set **found_properties);
+int bus_print_all_properties(sd_bus *bus, const char *dest, const char *path, bus_message_print_t func, char **filter, BusPrintPropertyFlags flags, sd_bus_error *reterr);