]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: Factor out bus_append_scope_property() for scopes
authorPhilip Withnall <withnall@endlessm.com>
Wed, 12 Jun 2019 07:52:48 +0000 (08:52 +0100)
committerPhilip Withnall <withnall@endlessm.com>
Mon, 29 Jul 2019 11:13:52 +0000 (12:13 +0100)
This introduces no functional changes, but will make some upcoming
changes a little clearer.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
src/shared/bus-unit-util.c

index 322204dd2214dd5f59caaa2abbae6b53e195d47c..dc7c2f41aa82769b45409afc7b4e9d0f66b6a9f0 100644 (file)
@@ -1401,6 +1401,14 @@ static int bus_append_path_property(sd_bus_message *m, const char *field, const
         return 0;
 }
 
+static int bus_append_scope_property(sd_bus_message *m, const char *field, const char *eq) {
+        if (streq(field, "TimeoutStopSec"))
+
+                return bus_append_parse_sec_rename(m, field, eq);
+
+        return 0;
+}
+
 static int bus_append_service_property(sd_bus_message *m, const char *field, const char *eq) {
         int r;
 
@@ -1789,15 +1797,15 @@ int bus_append_unit_property_assignment(sd_bus_message *m, UnitType t, const cha
                 break;
 
         case UNIT_SCOPE:
-
-                if (streq(field, "TimeoutStopSec"))
-                        return bus_append_parse_sec_rename(m, field, eq);
-
                 r = bus_append_cgroup_property(m, field, eq);
                 if (r != 0)
                         return r;
 
                 r = bus_append_kill_property(m, field, eq);
+                if (r != 0)
+                        return r;
+
+                r = bus_append_scope_property(m, field, eq);
                 if (r != 0)
                         return r;
                 break;