]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/dbus-manager: make output argument of transient_unit_from_message() optional
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 27 Jan 2025 00:24:16 +0000 (09:24 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 27 Jan 2025 12:55:53 +0000 (12:55 +0000)
src/core/dbus-manager.c

index 4b61002eac853abdfa4b106e2864f1d8494d54e6..b59f9dec76e3dbe0ea3f511ef1394f1784f41a2a 100644 (file)
@@ -971,7 +971,7 @@ static int transient_unit_from_message(
                 Manager *m,
                 sd_bus_message *message,
                 const char *name,
-                Unit **unit,
+                Unit **ret_unit,
                 sd_bus_error *error) {
 
         UnitType t;
@@ -1022,7 +1022,8 @@ static int transient_unit_from_message(
         unit_add_to_load_queue(u);
         manager_dispatch_load_queue(m);
 
-        *unit = u;
+        if (ret_unit)
+                *ret_unit = u;
 
         return 0;
 }
@@ -1042,14 +1043,13 @@ static int transient_aux_units_from_message(
                 return r;
 
         while ((r = sd_bus_message_enter_container(message, 'r', "sa(sv)")) > 0) {
-                const char *name = NULL;
-                Unit *u;
+                const char *name;
 
                 r = sd_bus_message_read(message, "s", &name);
                 if (r < 0)
                         return r;
 
-                r = transient_unit_from_message(m, message, name, &u, error);
+                r = transient_unit_from_message(m, message, name, /* unit = */ NULL, error);
                 if (r < 0)
                         return r;