path unit: add TriggerLimitBurst= and TriggerLimitIntervalSec=
Given there's now a default for these settings, also allow users to configure them, matching socket units
This commit is contained in:
@@ -49,6 +49,8 @@ const sd_bus_vtable bus_path_vtable[] = {
|
||||
SD_BUS_PROPERTY("MakeDirectory", "b", bus_property_get_bool, offsetof(Path, make_directory), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("DirectoryMode", "u", bus_property_get_mode, offsetof(Path, directory_mode), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Path, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
|
||||
SD_BUS_PROPERTY("TriggerLimitIntervalUSec", "t", bus_property_get_usec, offsetof(Path, trigger_limit.interval), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("TriggerLimitBurst", "u", bus_property_get_unsigned, offsetof(Path, trigger_limit.burst), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_VTABLE_END
|
||||
};
|
||||
|
||||
@@ -136,6 +138,12 @@ static int bus_path_set_transient_property(
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (streq(name, "TriggerLimitBurst"))
|
||||
return bus_set_transient_unsigned(u, name, &p->trigger_limit.burst, message, flags, error);
|
||||
|
||||
if (streq(name, "TriggerLimitIntervalUSec"))
|
||||
return bus_set_transient_usec(u, name, &p->trigger_limit.interval, message, flags, error);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user