From f948b9f8f9b5a57c14994534ac06ffe102a7c302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 9 Jul 2023 11:17:54 +0200 Subject: [PATCH] module/battery: regression: allow poll-interval == 0 The regression was introduced after 1.9.0, hence no changelog entry. --- modules/battery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/battery.c b/modules/battery.c index 90737a3..f838c8e 100644 --- a/modules/battery.c +++ b/modules/battery.c @@ -586,7 +586,9 @@ conf_verify_poll_interval(keychain_t *chain, const struct yml_node *node) if (!conf_verify_unsigned(chain, node)) return false; - if (yml_value_as_int(node) < min_poll_interval) { + const long value = yml_value_as_int(node); + + if (value != 0 && value < min_poll_interval) { LOG_ERR("%s: interval value cannot be less than %ldms", conf_err_prefix(chain, node), min_poll_interval); return false;