From: Zbigniew Jędrzejewski-Szmek Date: Fri, 4 Jul 2025 10:07:13 +0000 (+0200) Subject: shared/bus-unit-util: also send empty array for LogFilterPatterns= X-Git-Tag: v258-rc1~150^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d853534edb186b079030adb5f3c602ef58fee41;p=thirdparty%2Fsystemd.git shared/bus-unit-util: also send empty array for LogFilterPatterns= 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. --- diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 9a4a8a865ae..e053cd31a61 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -1223,15 +1223,10 @@ static int bus_append_log_extra_fields(sd_bus_message *m, const char *field, con } 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) {