module/battery: regression: allow poll-interval == 0

The regression was introduced after 1.9.0, hence no changelog entry.
This commit is contained in:
Daniel Eklöf 2023-07-09 11:17:54 +02:00
parent 6220a07aaf
commit f948b9f8f9
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -586,7 +586,9 @@ conf_verify_poll_interval(keychain_t *chain, const struct yml_node *node)
if (!conf_verify_unsigned(chain, node)) if (!conf_verify_unsigned(chain, node))
return false; 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", LOG_ERR("%s: interval value cannot be less than %ldms",
conf_err_prefix(chain, node), min_poll_interval); conf_err_prefix(chain, node), min_poll_interval);
return false; return false;