mirror of
https://github.com/systemd/systemd.git
synced 2025-03-29 06:50:16 +03:00
varlink: rely on sd_varlink_dispatch() for validating zero-argument method calls, too
This commit is contained in:
parent
fa3137f9d0
commit
a7cc7038ac
@ -25,11 +25,16 @@ SD_VARLINK_DEFINE_INTERFACE(
|
||||
SD_VARLINK_SYMBOL_COMMENT("Sets the maximum log level."),
|
||||
&vl_method_SetLogLevel);
|
||||
|
||||
/* Generic implementations for some of the method calls above */
|
||||
|
||||
int varlink_method_ping(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata) {
|
||||
int r;
|
||||
|
||||
assert(link);
|
||||
|
||||
if (sd_json_variant_elements(parameters) > 0)
|
||||
return sd_varlink_error_invalid_parameter(link, parameters);
|
||||
r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL);
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
log_debug("Received io.systemd.service.Ping");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user