summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes2
-rw-r--r--event.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/Changes b/Changes
index 8375f27..2c7e50f 100644
--- a/Changes
+++ b/Changes
@@ -7,6 +7,8 @@ TODO: EV_USE__XXX default with config, document
- "PORTING FROM LIBEV 3.X TO 4.X" (in ev.pod) is recommended reading.
- ev_embed_stop did not correctly stop the watcher (very good
testcase by Vladimir Timofeev).
+ - fix a bug where a timeout of zero caused the timer not to fire
+ in the libevent emulation (testcase by Péter Szabó).
- applied win32 fixes by Michael Lenaghan (also James Mansion).
- replace EV_MINIMAL by EV_FEATURES.
- prefer EPOLL_CTL_ADD over EPOLL_CTL_MOD in some more cases, as it
diff --git a/event.c b/event.c
index fae26bb..4124769 100644
--- a/event.c
+++ b/event.c
@@ -74,7 +74,10 @@ static ev_tstamp
ev_tv_get (struct timeval *tv)
{
if (tv)
- return tv->tv_sec + tv->tv_usec * 1e-6;
+ {
+ ev_tstamp after = tv->tv_sec + tv->tv_usec * 1e-6;
+ return after ? after : 1e-6;
+ }
else
return -1.;
}