mirror of
https://github.com/hufrea/byedpi.git
synced 2025-06-30 02:31:15 +00:00
Fix timer if time diff is zero
This commit is contained in:
parent
d1f1ae0918
commit
0028c8ced8
12
conev.c
12
conev.c
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user