No functional changes, just less code.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
// 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;
}