1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

varlink: make use of varlink_error_invalid_parameter() helper where appropriate

This commit is contained in:
Lennart Poettering 2023-12-21 15:47:26 +01:00
parent afc50293bb
commit c2fb27ca04

View File

@ -1176,9 +1176,7 @@ static int generic_method_get_info(
assert(link);
if (json_variant_elements(parameters) != 0)
return varlink_errorb(link, VARLINK_ERROR_INVALID_PARAMETER,
JSON_BUILD_OBJECT(
JSON_BUILD_PAIR_VARIANT("parameter", json_variant_by_index(parameters, 0))));
return varlink_error_invalid_parameter(link, parameters);
product = strjoin("systemd (", program_invocation_short_name, ")");
if (!product)