From eae194a51b2b4d2cea4d4f0897063b45f6787688 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 19 Dec 2017 15:32:11 +0900 Subject: [PATCH] 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`. --- src/shared/bus-unit-util.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 92a7de8..b9f8f69 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -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) { - - r = sd_bus_message_append(m, "(sv)", field, "as", 1, eq); - if (r < 0) - return bus_log_create_error(r); + if (unit_dependency_from_string(field) >= 0) - return 1; - } + return bus_append_strv(m, field, eq, EXTRACT_QUOTES); return 0; } -- 2.7.4