2025-04-12 15:22:19 +02:00

29 lines
1.1 KiB
Diff

--- a/log.c
+++ b/log.c
@@ -595,14 +595,14 @@
olast_event == 0 ? -1 : (long)(now - olast_event)));
if (rl->hysteresis_start == 0) {
/* active, but under threshold; hysteresis */
- if (olast_event + rl->hysteresis < now) {
+ if (olast_event + (time_t)rl->hysteresis < now) {
/* hysteresis expired before this event */
RLDBG(("hysteresis preexpired"));
goto inactive;
}
RLDBG(("start hysteresis"));
rl->hysteresis_start = now;
- } else if (rl->hysteresis_start + rl->hysteresis < now) {
+ } else if (rl->hysteresis_start + (time_t)rl->hysteresis < now) {
/* Hysteresis period expired, transition to inactive */
RLDBG(("complete hysteresis"));
inactive:
@@ -640,7 +640,7 @@
*active = 1;
RLDBG(("log_every=%u since_log=%ld", rl->log_every,
(long)(now - rl->last_log)));
- if (rl->log_every > 0 && now >= rl->last_log + rl->log_every) {
+ if (rl->log_every > 0 && now >= rl->last_log + (time_t)rl->log_every) {
RLDBG(("periodic: since_last=%u", rl->ratelimited_events));
rl->last_log = now;
if (events_dropped != NULL) {