1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00

bus-unit-util: make dependency settings can take multiple units

This allows people to specify multiple units in dependency settings
e.g. `Requires=foo.service baz.service`.
This commit is contained in:
Yu Watanabe 2017-12-19 15:32:11 +09:00
parent b48e508db3
commit eae194a51b

View File

@ -1293,8 +1293,6 @@ static int bus_append_timer_property(sd_bus_message *m, const char *field, const
}
static int bus_append_unit_property(sd_bus_message *m, const char *field, const char *eq) {
UnitDependency dep;
int r;
if (STR_IN_SET(field, "Description", "CollectMode", "FailureAction", "SuccessAction"))
@ -1304,14 +1302,9 @@ static int bus_append_unit_property(sd_bus_message *m, const char *field, const
return bus_append_parse_boolean(m, field, eq);
if ((dep = unit_dependency_from_string(field)) >= 0) {
if (unit_dependency_from_string(field) >= 0)
r = sd_bus_message_append(m, "(sv)", field, "as", 1, eq);
if (r < 0)
return bus_log_create_error(r);
return 1;
}
return bus_append_strv(m, field, eq, EXTRACT_QUOTES);
return 0;
}