Fix bug in event timeout handling
Submitted by: mav MFC after: 3 days
This commit is contained in:
parent
69948a10db
commit
dba59455b3
@ -110,12 +110,12 @@ __event_dispatch(void)
|
||||
event_del(ev);
|
||||
|
||||
if (ev->flags & EV_HAS_TIMEOUT) {
|
||||
t = now;
|
||||
|
||||
if (tv_cmp(&t, &ev->expire) <= 0)
|
||||
if (tv_cmp(&now, &ev->expire) >= 0)
|
||||
t.tv_sec = t.tv_usec = 0;
|
||||
else
|
||||
tv_sub(&t, &ev->expire);
|
||||
else {
|
||||
t = ev->expire;
|
||||
tv_sub(&t, &now);
|
||||
}
|
||||
|
||||
if (tv_cmp(&t, &timeout) < 0)
|
||||
timeout = t;
|
||||
|
Loading…
Reference in New Issue
Block a user