return 0;
}
+static int bus_try_append_unit_dependency(sd_bus_message *m, const char *field, const char *eq) {
+ if (unit_dependency_from_string(field) < 0)
+ return 0;
+
+ return bus_append_strv(m, field, eq);
+}
+
static int bus_append_cgroup_property(sd_bus_message *m, const char *field, const char *eq) {
if (STR_IN_SET(field, "DevicePolicy",
"Slice",
}
static int bus_append_unit_property(sd_bus_message *m, const char *field, const char *eq) {
+ int r;
+
if (STR_IN_SET(field, "Description",
"SourcePath",
"OnFailureJobMode",
"FailureActionExitStatus"))
return bus_append_action_exit_status(m, field, eq);
- if (unit_dependency_from_string(field) >= 0 ||
- STR_IN_SET(field, "Documentation",
+ if (STR_IN_SET(field, "Documentation",
"RequiresMountsFor",
"WantsMountsFor",
"Markers"))
return bus_append_strv(m, field, eq);
+ r = bus_try_append_unit_dependency(m, field, eq);
+ if (r != 0)
+ return r;
+
return bus_try_append_condition(m, field, eq);
}