0
0
mirror of https://github.com/hufrea/byedpi.git synced 2025-06-30 10:33:50 +00:00

Fix timer if time diff is zero

This commit is contained in:
ruti 2025-02-09 13:28:33 +03:00
parent d1f1ae0918
commit 0028c8ced8

12
conev.c
View File

@ -291,14 +291,14 @@ void remove_timer(struct poolhd *pool, struct eval *val)
struct eval *next_event_tv(struct poolhd *pool, int *offs, int *type) struct eval *next_event_tv(struct poolhd *pool, int *offs, int *type)
{ {
int ms = 0; if (!pool->tv_start) {
return next_event(pool, offs, type, -1);
}
struct eval *val = 0; struct eval *val = 0;
if (pool->tv_start) { int ms = pool->tv_start->tv_ms - time_ms();
ms = pool->tv_start->tv_ms - time_ms(); if (ms > 0) {
} val = next_event(pool, offs, type, ms);
if (ms >= 0) {
val = next_event(pool, offs, type, ms ? ms : -1);
} }
else *type = POLLTIMEOUT; else *type = POLLTIMEOUT;