]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: ioloop - Use time_max_safe_value() for infinite-wait sentinel
authorAki Tuomi <aki.tuomi@open-xchange.com>
Sat, 11 Jul 2026 18:53:40 +0000 (18:53 +0000)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 24 Jul 2026 10:20:29 +0000 (10:20 +0000)
Reuse the shared bound instead of duplicating the TIME_T_MAX_BITS
computation. Widens the sentinel from 2^(TIME_T_MAX_BITS-1)-1 to
2^TIME_T_MAX_BITS-1, matching time_max_safe_value()'s bound.

src/lib/ioloop.c

index ecb0440570273bbffb45cded58444c1422890f9c..492d109da11f6ceee58b6c28e67c083b026c88f3 100644 (file)
@@ -511,7 +511,7 @@ static int io_loop_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r)
                   return -1 for poll/epoll infinity. */
                tv_r->tv_sec = INT_MAX / 1000;
                tv_r->tv_usec = 0;
-               ioloop->next_max_time.tv_sec = (1ULL << (TIME_T_MAX_BITS-1)) - 1;
+               ioloop->next_max_time.tv_sec = time_max_safe_value();
                ioloop->next_max_time.tv_usec = 0;
                return -1;
        }