summaryrefslogtreecommitdiff
path: root/evutil.c
diff options
context:
space:
mode:
authorChristopher Davis <chrisd@mangrin.org>2010-04-09 19:16:09 -0700
committerChristopher Davis <chrisd@mangrin.org>2010-04-09 19:16:09 -0700
commit8f9e60c825768c6dbc22fb6a2874b1f47cb34287 (patch)
treeece2d0ca7a133d196dfe40a312331f02472ca3de /evutil.c
parent850c3ff232659125262bb5e30bef8451fac386bf (diff)
downloadlibevent-8f9e60c825768c6dbc22fb6a2874b1f47cb34287.tar.gz
Always round up when there's a fractional number of msecs.
Diffstat (limited to 'evutil.c')
-rw-r--r--evutil.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/evutil.c b/evutil.c
index 3ca9fef9..b75a4697 100644
--- a/evutil.c
+++ b/evutil.c
@@ -1904,6 +1904,6 @@ evutil_tv_to_msec(const struct timeval *tv)
if (tv->tv_usec > 1000000 || tv->tv_sec > MAX_SECONDS_IN_MSEC_LONG)
return -1;
- return (tv->tv_sec * 1000) + (tv->tv_usec / 1000);
+ return (tv->tv_sec * 1000) + ((tv->tv_usec + 999) / 1000);
}