From: Ivan Kruglov Date: Wed, 9 Oct 2024 11:35:58 +0000 (+0200) Subject: machine: use sd_json_dispatch_signal() in varlink code X-Git-Tag: v257-rc1~259^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45a20e41dffaa1debf64e03288a2fb48aa93be7d;p=thirdparty%2Fsystemd.git machine: use sd_json_dispatch_signal() in varlink code --- diff --git a/src/machine/machine-varlink.c b/src/machine/machine-varlink.c index 0f14e3063ab..f75f481e6e5 100644 --- a/src/machine/machine-varlink.c +++ b/src/machine/machine-varlink.c @@ -332,7 +332,7 @@ int vl_method_kill(sd_varlink *link, sd_json_variant *parameters, sd_varlink_met static const sd_json_dispatch_field dispatch_table[] = { VARLINK_DISPATCH_MACHINE_LOOKUP_FIELDS(struct params), { "whom", SD_JSON_VARIANT_STRING, sd_json_dispatch_const_string, offsetof(struct params, swhom), 0 }, - { "signal", _SD_JSON_VARIANT_TYPE_INVALID , sd_json_dispatch_int32, offsetof(struct params, signo), SD_JSON_MANDATORY }, + { "signal", _SD_JSON_VARIANT_TYPE_INVALID , sd_json_dispatch_signal, offsetof(struct params, signo), SD_JSON_MANDATORY }, VARLINK_DISPATCH_POLKIT_FIELD, {} }; @@ -364,9 +364,6 @@ int vl_method_kill(sd_varlink *link, sd_json_variant *parameters, sd_varlink_met return sd_varlink_error_invalid_parameter_name(link, "whom"); } - if (!SIGNAL_VALID(p.signo)) - return sd_varlink_error_invalid_parameter_name(link, "signal"); - r = varlink_verify_polkit_async( link, manager->bus,