From: Michael Tremer Date: Fri, 3 Oct 2025 09:48:13 +0000 (+0000) Subject: client: Use a helper function to send format X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79cd5113231050182f8cb40b97131137cf180fc6;p=telemetry.git client: Use a helper function to send format No functional changes, just less code. Signed-off-by: Michael Tremer --- diff --git a/src/client/main.c b/src/client/main.c index 304abdc..b86edc7 100644 --- a/src/client/main.c +++ b/src/client/main.c @@ -154,21 +154,7 @@ static int render(collecty_client_ctx* ctx) { // Is available, add the desired output format if (ctx->format) { - r = sd_bus_message_open_container(m, 'e', "sv"); - if (r < 0) - goto ERROR; - - // Add key - r = sd_bus_message_append(m, "s", "format"); - if (r < 0) - goto ERROR; - - // Add the value - r = sd_bus_message_append(m, "v", "s", ctx->format); - if (r < 0) - goto ERROR; - - r = sd_bus_message_close_container(m); + r = sd_bus_message_append(m, "{sv}", "format", "s", ctx->format); if (r < 0) goto ERROR; }