Before, for empty input, we'd send an array with one item with an empty
pattern. Use the helper which sends an empty array instead.
bus_exec_context_set_transient_property() ignores items with an empty
pattern, so the result should be the same.
Request in review:
https://github.com/systemd/systemd/pull/37665#discussion_r2182375988.
}
static int bus_append_log_filter_patterns(sd_bus_message *m, const char *field, const char *eq) {
- int r;
-
- r = sd_bus_message_append(m, "(sv)", "LogFilterPatterns", "a(bs)", 1,
- eq[0] != '~',
- eq[0] != '~' ? eq : eq + 1);
- if (r < 0)
- return bus_log_create_error(r);
-
- return 1;
+ return bus_append_trivial_array(m, field, eq,
+ "a(bs)",
+ eq[0] != '~',
+ eq[0] != '~' ? eq : eq + 1);
}
static int bus_append_standard_inputs(sd_bus_message *m, const char *field, const char *eq) {