diff options
author | Philip Withnall <withnall@endlessm.com> | 2019-06-12 08:52:48 +0100 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2019-07-29 12:13:52 +0100 |
commit | 5a70a68fd6568639b1739d4be6130d15cf91a39f (patch) | |
tree | fb44fb84dd892f3a6c78d71d1e2294aaff67d4e1 /src | |
parent | ef71cc77873c9697e8fb91ee1ca25c40d138c224 (diff) | |
download | systemd-5a70a68fd6568639b1739d4be6130d15cf91a39f.tar.gz |
shared: Factor out bus_append_scope_property() for scopes
This introduces no functional changes, but will make some upcoming
changes a little clearer.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/bus-unit-util.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 322204dd22..dc7c2f41aa 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -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,10 +1797,6 @@ 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; @@ -1800,6 +1804,10 @@ int bus_append_unit_property_assignment(sd_bus_message *m, UnitType t, const cha 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; case UNIT_MOUNT: |